Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public static function fromConfig(MapInterface $config, Types $types) : TypeInterface
 {
     if ((string) $config->keyType() !== 'scalar' || (string) $config->valueType() !== 'variable') {
         throw new InvalidArgumentException();
     }
     $type = new self();
     $type->innerKey = $config->get('key');
     $type->innerValue = $config->get('inner');
     $type->inner = $types->build($config->get('inner'), $config->remove('inner')->remove('key'));
     $type->key = $types->build($config->get('key'), $config->remove('inner')->remove('key'));
     return $type;
 }