function httpRequestUriOffsetIs(uri\offset $offset) { $uri = parent::valueIs('/' . (new risingsun\ostring(self::normalize($this)))->ostringOffsetIs(new risingsun\ostring\offset($offset->value))); $uri->ifEqualToString($this, function () use(&$uri) { $uri = new self('/1'); }); return $uri; }
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) { $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, data\name ...$names) { parent::__construct($value); $this->names = $names; }
function ifIsStartOfString(self $string, callable $isStart, callable $isNotStart = null) { $string->ifStartWithString($this, $isStart, $isNotStart); return $this; }