Skip to content

Commit e77c0f3

Browse files
committed
[BrowserKit] Add types to private properties
Signed-off-by: Alexander M. Turek <me@derrabus.de>
1 parent f76d834 commit e77c0f3

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

AbstractBrowser.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ abstract class AbstractBrowser
4242
protected $followRedirects = true;
4343
protected $followMetaRefresh = false;
4444

45-
private $maxRedirects = -1;
46-
private $redirectCount = 0;
47-
private $redirects = [];
48-
private $isMainRequest = true;
45+
private int $maxRedirects = -1;
46+
private int $redirectCount = 0;
47+
private array $redirects = [];
48+
private bool $isMainRequest = true;
4949

5050
/**
5151
* @param array $server The server parameters (equivalent of $_SERVER)

Cookie.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Cookie
4040
protected $secure;
4141
protected $httponly;
4242
protected $rawValue;
43-
private $samesite;
43+
private ?string $samesite;
4444

4545
/**
4646
* Sets a cookie.

HttpBrowser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727
class HttpBrowser extends AbstractBrowser
2828
{
29-
private $client;
29+
private HttpClientInterface $client;
3030

3131
public function __construct(HttpClientInterface $client = null, History $history = null, CookieJar $cookieJar = null)
3232
{

Response.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
*/
1717
final class Response
1818
{
19-
private $content;
20-
private $status;
21-
private $headers;
19+
private string $content;
20+
private int $status;
21+
private array $headers;
2222

2323
/**
2424
* The headers array is a set of key/value pairs. If a header is present multiple times

Test/Constraint/BrowserCookieValueSame.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717
final class BrowserCookieValueSame extends Constraint
1818
{
19-
private $name;
20-
private $value;
21-
private $raw;
22-
private $path;
23-
private $domain;
19+
private string $name;
20+
private string $value;
21+
private bool $raw;
22+
private string $path;
23+
private ?string $domain;
2424

2525
public function __construct(string $name, string $value, bool $raw = false, string $path = '/', string $domain = null)
2626
{

Test/Constraint/BrowserHasCookie.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
final class BrowserHasCookie extends Constraint
1818
{
19-
private $name;
20-
private $path;
21-
private $domain;
19+
private string $name;
20+
private string $path;
21+
private ?string $domain;
2222

2323
public function __construct(string $name, string $path = '/', string $domain = null)
2424
{

0 commit comments

Comments
 (0)