getResponse(); if ($response->getUrl()->match(static::$pattern)) { return new static($response); } } /** * Constructor. * * @param Response $response */ protected function __construct(Response $response) { $this->response = $response; } /** * {@inheritdoc} */ public function getEndPoint() { return Url::create(static::$endPoint) ->withQueryParameters([ 'url' => (string) $this->response->getUrl(), 'format' => 'json', ]); } }