Skip to content

Commit 3fcf2f6

Browse files
Replace more docblocks by type-hints
1 parent 77d4f2e commit 3fcf2f6

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public function submit(Form $form, array $values = array())
272272
*
273273
* @return Crawler
274274
*/
275-
public function request($method, $uri, array $parameters = array(), array $files = array(), array $server = array(), $content = null, $changeHistory = true)
275+
public function request(string $method, string $uri, array $parameters = array(), array $files = array(), array $server = array(), string $content = null, bool $changeHistory = true)
276276
{
277277
if ($this->isMainRequest) {
278278
$this->redirectCount = 0;

Cookie.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Cookie
5353
* @param bool $httponly The cookie httponly flag
5454
* @param bool $encodedValue Whether the value is encoded or not
5555
*/
56-
public function __construct($name, $value, $expires = null, $path = null, $domain = '', $secure = false, $httponly = true, $encodedValue = false)
56+
public function __construct(string $name, ?string $value, string $expires = null, string $path = null, string $domain = '', bool $secure = false, bool $httponly = true, bool $encodedValue = false)
5757
{
5858
if ($encodedValue) {
5959
$this->value = urldecode($value);
@@ -65,8 +65,8 @@ public function __construct($name, $value, $expires = null, $path = null, $domai
6565
$this->name = $name;
6666
$this->path = empty($path) ? '/' : $path;
6767
$this->domain = $domain;
68-
$this->secure = (bool) $secure;
69-
$this->httponly = (bool) $httponly;
68+
$this->secure = $secure;
69+
$this->httponly = $httponly;
7070

7171
if (null !== $expires) {
7272
$timestampAsDateTime = \DateTime::createFromFormat('U', $expires);

Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Request
3333
* @param array $server An array of server parameters
3434
* @param string $content The raw body data
3535
*/
36-
public function __construct($uri, $method, array $parameters = array(), array $files = array(), array $cookies = array(), array $server = array(), $content = null)
36+
public function __construct(string $uri, string $method, array $parameters = array(), array $files = array(), array $cookies = array(), array $server = array(), string $content = null)
3737
{
3838
$this->uri = $uri;
3939
$this->method = $method;

Response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Response
2828
* @param int $status The response status code
2929
* @param array $headers An array of headers
3030
*/
31-
public function __construct($content = '', $status = 200, array $headers = array())
31+
public function __construct(string $content = '', int $status = 200, array $headers = array())
3232
{
3333
$this->content = $content;
3434
$this->status = $status;

0 commit comments

Comments
 (0)