original_string: public static function initField($configuration = [])
      {
          if (!array_key_exists('type', $configuration) || !class_exists($configuration['type'])) {
              throw new InvalidFieldTypeException('You did not specify a type on this class.');
          }
  
          $collection = new static();
          $collection->configuration = $configuration;
          $collection->type = $configuration['type'];
  
          if (array_key_exists('max_items', $configuration)) {
              $collection->maxItems = $configuration['max_items'];
          }
  
          return $collection;
      }
code: public static function initField($configuration = [])
      {
          if (!array_key_exists('type', $configuration) || !class_exists($configuration['type'])) {
              throw new InvalidFieldTypeException('You did not specify a type on this class.');
          }
  
          $collection = new static();
          $collection->configuration = $configuration;
          $collection->type = $configuration['type'];
  
          if (array_key_exists('max_items', $configuration)) {
              $collection->maxItems = $configuration['max_items'];
          }
  
          return $collection;
      }
code_tokens: public static function initField ( $ configuration = [ ] ) { if ( ! array_key_exists ( 'type' , $ configuration ) || ! class_exists ( $ configuration [ 'type' ] ) ) { throw new InvalidFieldTypeException ( 'You did not specify a type on this class.' ) ; } $ collection = new static ( ) ; $ collection -> configuration = $ configuration ; $ collection -> type = $ configuration [ 'type' ] ; if ( array_key_exists ( 'max_items' , $ configuration ) ) { $ collection -> maxItems = $ configuration [ 'max_items' ] ; } return $ collection ; }
docstring: Initialize a collection with the configuration
  
  @param array $configuration
  @throws InvalidFieldTypeException
  @return static
docstring_tokens: Initialize a collection with the configuration