public function __construct(Endpoint $endpoint, $index, $isDefault = false) { Assertion::integer($index); Assertion::boolean($isDefault); $this->endpoint = $endpoint; $this->index = $index; $this->isDefault = $isDefault; }
/** * @param string $scope the scope as defined * @param bool $isRegexp whether or not the scope is a regular expression as identified by the regexp attribute */ public function __construct($scope, $isRegexp = false) { Assertion::nonEmptyString($scope, 'scope'); Assertion::boolean($isRegexp); if ($isRegexp) { Assertion::validRegularExpression($scope, 'scope'); } $this->scope = $scope; $this->isRegexp = $isRegexp; }