public function __construct($value) { if (!in_array(strtoupper($value), $this->allowed_methods)) { throw new MethodNotAllowedException($value, $this->allowed_methods); } parent::__construct($value); }
/** * Returns a Hostname * * @param string $value */ public function __construct($value) { $validator = new Hostname(array('allow' => Hostname::ALLOW_DNS | Hostname::ALLOW_LOCAL)); if (false === $validator->isValid($value)) { throw new InvalidValueObjectsArgumentException($value, 'Hostname'); } parent::__construct($value); }