function __construct($value) { $domainException = null; try { parent::__construct($value); } catch (\domainException $domainException) { } if ($domainException || !self::isSegment($value)) { throw new \domainException('Value should be a valid HTTP request URI segment'); } }
function __construct($value) { $domainException = null; try { parent::__construct($value); } catch (\domainException $domainException) { } if ($domainException || self::isEmpty($value)) { throw new \domainException('Value should be a not empty string'); } }
function __construct($value, data\name ...$names) { parent::__construct($value); $this->names = $names; }
function __construct($value = '/') { self::valueForCallableIs(function ($value) { parent::__construct($value); }, $value); }