original_string: public function toArray($recursive = true)
      {
          $results     = [];
          $collections = $this->collections;
  
          if ($recursive) {
              foreach ($collections as $key => $value) {
                  if ($value instanceof CollectionInterface) {
                      /** @noinspection PhpMethodParametersCountMismatchInspection */
                      $results[$key] = $value->toArray($recursive);
                  } else {
                      $results[$key] = $value;
                  }
              }
          } else {
              foreach ($collections as $key => $value) {
                  $results[$key] = $value;
              }
          }
  
          return $results;
      }
code: public function toArray($recursive = true)
      {
          $results     = [];
          $collections = $this->collections;
  
          if ($recursive) {
              foreach ($collections as $key => $value) {
                  if ($value instanceof CollectionInterface) {
                      /** @noinspection PhpMethodParametersCountMismatchInspection */
                      $results[$key] = $value->toArray($recursive);
                  } else {
                      $results[$key] = $value;
                  }
              }
          } else {
              foreach ($collections as $key => $value) {
                  $results[$key] = $value;
              }
          }
  
          return $results;
      }
code_tokens: public function toArray ( $ recursive = true ) { $ results = [ ] ; $ collections = $ this -> collections ; if ( $ recursive ) { foreach ( $ collections as $ key => $ value ) { if ( $ value instanceof CollectionInterface ) { /** @noinspection PhpMethodParametersCountMismatchInspection */ $ results [ $ key ] = $ value -> toArray ( $ recursive ) ; } else { $ results [ $ key ] = $ value ; } } } else { foreach ( $ collections as $ key => $ value ) { $ results [ $ key ] = $ value ; } } return $ results ; }
docstring: Get the array representation of this object.
  
  @param bool $recursive
  
  @return array
docstring_tokens: Get the array representation of this object .