Esempio n. 1
0
 public function __construct(MapInterface $parameters)
 {
     if ((string) $parameters->keyType() !== 'string' || (string) $parameters->valueType() !== ParameterInterface::class) {
         throw new InvalidArgumentException();
     }
     $this->parameters = $parameters;
 }
Esempio n. 2
0
 public function __construct(MapInterface $files)
 {
     if ((string) $files->keyType() !== 'string' || (string) $files->valueType() !== FileInterface::class) {
         throw new InvalidArgumentException();
     }
     $this->files = $files;
 }
Esempio n. 3
0
 public function __construct(MapInterface $variables)
 {
     if ((string) $variables->keyType() !== 'string' || (string) $variables->valueType() !== 'scalar') {
         throw new InvalidArgumentException();
     }
     $this->variables = $variables;
 }
Esempio n. 4
0
 public function __construct(MapInterface $verifiers)
 {
     if ((string) $verifiers->keyType() !== 'int' || (string) $verifiers->valueType() !== VerifierInterface::class) {
         throw new InvalidArgumentException();
     }
     $this->verifiers = $verifiers;
 }
 public function __construct(MapInterface $errors)
 {
     if ((string) $errors->keyType() !== 'string' || (string) $errors->valueType() !== NormalizationException::class) {
         throw new InvalidArgumentException();
     }
     $this->errors = $errors;
     parent::__construct('The input resource is not normalizable');
 }
Esempio n. 6
0
 public function __construct(QueryInterface $query, MapInterface $variables)
 {
     if ((string) $variables->keyType() !== 'string' || (string) $variables->valueType() !== EntityInterface::class) {
         throw new InvalidArgumentException();
     }
     $this->query = $query;
     $this->variables = $variables;
 }
Esempio n. 7
0
 public function __construct($identifier, MapInterface $cells)
 {
     if (!is_scalar($identifier) || (string) $cells->keyType() !== 'scalar' || (string) $cells->valueType() !== CellInterface::class) {
         throw new InvalidArgumentException();
     }
     $this->identifier = $identifier;
     $this->cells = $cells;
 }
Esempio n. 8
0
 public function __construct(string $name, MapInterface $properties)
 {
     if (empty($name) || (string) $properties->keyType() !== 'string' || (string) $properties->valueType() !== Property::class) {
         throw new InvalidArgumentException();
     }
     $this->name = $name;
     $this->properties = $properties;
 }
Esempio n. 9
0
 public function __construct(string $delimiter, bool $withHeader, MapInterface $formatters)
 {
     if (empty($delimiter) || (string) $formatters->keyType() !== 'string' || (string) $formatters->valueType() !== FormatterInterface::class) {
         throw new InvalidArgumentException();
     }
     $this->delimiter = $delimiter;
     $this->withHeader = $withHeader;
     $this->formatters = $formatters;
 }
Esempio n. 10
0
 public function __construct(string $name, MapInterface $attributes)
 {
     if (empty($name) || (string) $attributes->keyType() !== 'string' || (string) $attributes->valueType() !== AttributeInterface::class) {
         throw new InvalidArgumentException();
     }
     $this->name = $name;
     $this->content = $attributes;
     $this->parsingTime = $attributes->reduce(0, function (int $parsingTime, string $name, AttributeInterface $attribute) : int {
         return $parsingTime += $attribute->parsingTime();
     });
 }
Esempio n. 11
0
 public function __construct(string $name, UrlInterface $url, Identity $identity, MapInterface $properties, MapInterface $metas, bool $rangeable)
 {
     if (empty($name) || (string) $properties->keyType() !== 'string' || (string) $properties->valueType() !== Property::class || (string) $metas->keyType() !== 'scalar' || (string) $metas->valueType() !== 'variable') {
         throw new InvalidArgumentException();
     }
     $this->name = $name;
     $this->url = $url;
     $this->identity = $identity;
     $this->properties = $properties;
     $this->metas = $metas;
     $this->rangeable = $rangeable;
 }
Esempio n. 12
0
 public function __construct(UrlInterface $url, MediaTypeInterface $mediaType, MapInterface $attributes, StreamInterface $content)
 {
     if ((string) $attributes->keyType() !== 'string' || (string) $attributes->valueType() !== AttributeInterface::class) {
         throw new InvalidArgumentException();
     }
     $name = basename((string) $url->path());
     $this->url = $url;
     $this->name = new Name(empty($name) ? 'index' : $name);
     $this->mediaType = $mediaType;
     $this->attributes = $attributes;
     $this->content = $content;
 }
Esempio n. 13
0
 public function __construct(ResourceDefinition $definition, MapInterface $properties)
 {
     if ((string) $properties->keyType() !== 'string' || (string) $properties->valueType() !== Property::class) {
         throw new InvalidArgumentException();
     }
     $this->definition = $definition;
     $this->properties = $properties;
     $this->properties->foreach(function (string $name, Property $property) {
         if (!$this->definition->properties()->contains($name)) {
             throw new InvalidArgumentException();
         }
     });
 }
Esempio n. 14
0
 public function __construct(string $name, Identity $identity, MapInterface $properties, MapInterface $options, MapInterface $metas, Gateway $gateway, bool $rangeable, MapInterface $allowedLinks)
 {
     if ((string) $properties->keyType() !== 'string' || (string) $properties->valueType() !== Property::class || (string) $options->keyType() !== 'scalar' || (string) $options->valueType() !== 'variable' || (string) $metas->keyType() !== 'scalar' || (string) $metas->valueType() !== 'variable' || (string) $allowedLinks->keyType() !== 'string' || (string) $allowedLinks->valueType() !== 'string') {
         throw new InvalidArgumentException();
     }
     $this->name = $name;
     $this->identity = $identity;
     $this->properties = $properties;
     $this->options = $options;
     $this->metas = $metas;
     $this->gateway = $gateway;
     $this->rangeable = $rangeable;
     $this->allowedLinks = $allowedLinks;
 }