public function match(UriInterface $uri) { /* * if the URI does not contain the seed, it is not allowed */ return false === stripos($uri->toString(), $this->seed->toString()); }
/** * @return Resource * @throws \ErrorException */ public function doTestRequest() { $link = func_get_arg(0); switch ($link->toString()) { case $this->linkA->toString(): return $this->getResource($this->linkA, $this->responseA); case $this->linkB->toString(): return $this->getResource($this->linkB, $this->responseB); case $this->linkC->toString(): return $this->getResource($this->linkC, $this->responseC); case $this->linkD->toString(): return $this->getResource($this->linkD, $this->responseD); case $this->linkE->toString(): return $this->getResource($this->linkE, $this->responseE); case $this->linkF->toString(): return $this->getResource($this->linkF, $this->responseF); case $this->linkG->toString(): return $this->getResource($this->linkG, $this->responseG); default: throw new \ErrorException('The requested URI was not stubbed: ' . $link->toString()); } }
public function isValid(string $uri) : bool { $uriObject = new Uri($uri); return $uriObject->getScheme() === null || in_array(strtolower($uriObject->getScheme()), static::$schemeWhitelist); }