original_string: public function toArray($recursive = true)
      {
          $array = [];
          $data  = $this->data;
  
          /** @var self $value */
          foreach ($data as $key => $value) {
              if ($recursive && $value instanceof self) {
                  $array[$key] = $value->toArray();
              } else {
                  $array[$key] = $value;
              }
          }
  
          return $array;
      }
code: public function toArray($recursive = true)
      {
          $array = [];
          $data  = $this->data;
  
          /** @var self $value */
          foreach ($data as $key => $value) {
              if ($recursive && $value instanceof self) {
                  $array[$key] = $value->toArray();
              } else {
                  $array[$key] = $value;
              }
          }
  
          return $array;
      }
code_tokens: public function toArray ( $ recursive = true ) { $ array = [ ] ; $ data = $ this -> data ; /** @var self $value */ foreach ( $ data as $ key => $ value ) { if ( $ recursive && $ value instanceof self ) { $ array [ $ key ] = $ value -> toArray ( ) ; } else { $ array [ $ key ] = $ value ; } } return $ array ; }
docstring: Converts the instance to an array
  @param bool $recursive Converts containing configurations recursive as well.
  @return array
docstring_tokens: Converts the instance to an array