public function __construct(MapInterface $parameters) { if ((string) $parameters->keyType() !== 'string' || (string) $parameters->valueType() !== ParameterInterface::class) { throw new InvalidArgumentException(); } $this->parameters = $parameters; }
public function __construct(MapInterface $files) { if ((string) $files->keyType() !== 'string' || (string) $files->valueType() !== FileInterface::class) { throw new InvalidArgumentException(); } $this->files = $files; }
public function __construct(MapInterface $variables) { if ((string) $variables->keyType() !== 'string' || (string) $variables->valueType() !== 'scalar') { throw new InvalidArgumentException(); } $this->variables = $variables; }
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'); }
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; }
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; }
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; }
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; }
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(); }); }
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; }
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; }
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(); } }); }
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; }