private function addOption($name, $value) { Assert::notBlank($name, 'Option name cannot be empty'); $value = (int) $value; $this->options[$name] = $value; return $this; }
private function setName($name) { Assert::notBlank($name, 'Argument name cannot be blank'); $this->name = $name; }
private function setName($name) { Assert::notBlank($name, 'Name of property cannot be empty'); $this->name = $name; return $this; }
/** * @param string $name name of property * * @throws \InvalidArgumentException when name is invalid */ public function __construct($name) { Assert::notBlank($name, 'Name of class type cannot be empty'); $this->name = $name; $this->init(); }
/** * Register new style * * @param string $name style name * @param StyleInterface $style * @return self */ public function registerStyle($name, StyleInterface $style) { Assert::notBlank($name, 'Name of style cannot be empty'); $this->styles[$name] = $style; return $this; }
/** * @param string $name * @param TypeInterface $type * @return self * @throws \InvalidArgumentException when name is empty */ public function addType($name, TypeInterface $type) { Assert::notBlank($name, 'Name of type cannot be empty'); $this->types[$name] = $type; return $this; }
/** * @param string $name * @param TypeInterface $type * @throws \InvalidArgumentException when name is empty */ public function __construct($name, TypeInterface $type) { Assert::notBlank($name, 'Name of collection cannot be empty'); $this->name = $name; $this->setType($type); }
public function __construct($name) { Assert::notBlank($name, 'Class type implementation name cannot be empty'); $this->name = $name; }
/** * Sets target property name which gives us ability to map current property to another one with different name * * @param string $targetPropertyName * @return self * * @throws \InvalidArgumentException */ public function setTargetPropertyName($targetPropertyName) { Assert::notBlank($targetPropertyName, 'Name of target property cannot be empty'); $this->targetPropertyName = $targetPropertyName; return $this; }
/** * @param string $className * @param bool $exactMatch comparison should be performed by exact class name match (true) or instanceof operator (false) */ public function __construct($className, $exactMatch = false) { Assert::notBlank($className, 'Class name cannot be blank'); $this->className = ltrim($className, '\\'); $this->exactMatch = (bool) $exactMatch; }
/** * Registers alias for a type * * @param string $alias * @param string $type * @throws \InvalidArgumentException when alias or type is blank */ public static function registerTypeAlias($alias, $type) { Assert::notBlank($alias, 'Alias name cannot be blank'); Assert::notBlank($type, 'Target type name cannot be blank'); self::$aliases[strtolower($alias)] = $type; }
private function setClass($class) { Assert::notBlank($class, 'Class name cannot be empty'); $this->reflection = null; $this->class = $class; return $this; }
private function setName($name) { Assert::notBlank($name, 'Method name cannot be empty'); $this->name = $name; return $this; }
public function mapToSpecialType($typeOutlineName, $targetTypeClass) { Assert::notBlank($typeOutlineName, 'Type outline name to map cannot be empty'); $this->map[$typeOutlineName] = $targetTypeClass; return $this; }
/** * @param string $propertyName property name * @throws \InvalidArgumentException when name is empty */ public function __construct($propertyName) { Assert::notBlank($propertyName, 'Property name cannot be empty'); $this->name = $propertyName; }