isValidValueForObjectProperty($this, $name, $val)) { throw new InvalidPropertyException(get_class($this), $name, $val); } if (SRSSTools::getPropertyType(static::class, $name) === 'array') { /** @var array $this->{$name} */ $this->{$name}[] = $val; } else { $val = is_string($val) ? (new Formator())->formatValue($this, $name, $val) : $val; $this->{$name} = $val; } } /** * @param $name * * @return bool */ public function __isset($name) { return isset($this->{$name}); } /** * getter of others attributes * * @param $name * * @return null|string */ public function __get($name) { return $this->{$name} ?? null; } }