Skip to content

Commit 30169b2

Browse files
committed
Add documentation and IDE type hints
1 parent 1321531 commit 30169b2

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Redirects.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
namespace Codeception\Module;
1212

1313
use Codeception\Module;
14+
use Symfony\Component\BrowserKit\Client;
15+
use Symfony\Component\BrowserKit\Response;
1416

1517
/**
16-
* Class Redirects
18+
* Redirects module for Codeception.
1719
*
1820
* @package Codeception\Module
1921
* @author Gary Jones
@@ -69,6 +71,7 @@ public function seePermanentRedirectToHttpFor($url)
6971
*/
7072
public function seePermanentRedirectTo($url)
7173
{
74+
/** @var Response $response */
7275
$response = $this->getModule('PhpBrowser')->client->getInternalResponse();
7376
$responseCode = $response->getStatus();
7477
$locationHeader = $response->getHeader('Location', true);
@@ -103,8 +106,12 @@ public function seePermanentRedirectToHttpsFor($url)
103106
protected function permanentRedirectForProtocol($url, $protocol)
104107
{
105108
$url = ltrim($url, '/');
106-
$this->getModule('REST')->sendHead($url);
107109

110+
/** @var REST $rest */
111+
$rest = $this->getModule('REST');
112+
$rest->sendHEAD($url);
113+
114+
/** @var Client $client */
108115
$client = $this->getModule('PhpBrowser')->client;
109116
$responseCode = $client->getInternalResponse()->getStatus();
110117
$responseUri = $client->getHistory()->current()->getUri();

0 commit comments

Comments
 (0)