public function __construct(string $value) { if (!(new FragmentSpecification())->isSatisfiedBy(new Url($value))) { throw new InvalidArgumentException(sprintf('The value "%s" is not a valid fragment', $value)); } parent::__construct($value); }
public function __construct(string $value) { parent::__construct($value); if (!$this->match('/^[a-z]+$/')) { throw new InvalidArgumentException(sprintf('The value "%s" is not a valid scheme', $value)); } }
public function __construct(string $value) { if (!(new AbsolutePath())->isSatisfiedBy(new Url($value))) { throw new InvalidArgumentException(sprintf('The value "%s" is not a valid path', $value)); } parent::__construct($value); }