/** * Get the HTTP Code Response given an URL instance * * @param Url $url Url * * @return int Response HTTP Code */ public function getResponseHTTPCode(Url $url) { try { $verb = $url->getOption('verb', 'GET'); $client = $this->client; $result = $client->send(class_exists('\\GuzzleHttp\\Psr7\\Request') ? new \GuzzleHttp\Psr7\Request($verb, $url->getPath()) : $client->createRequest($verb, $url->getPath()))->getStatusCode(); } catch (Exception $e) { $result = 400; } return $result; }
/** * Expires the authentication if these has been created * * @param Url $url Url * * @return $this Self object */ protected function expireAuthentication(Url $url) { $session = $this->session; $session->remove('_security_' . $url->getOption('firewall')); $session->save(); $this->client->getCookieJar()->expire($session->getName()); return $this; }