Skip to content

Commit

Permalink
docs: add array types
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Apr 11, 2024
1 parent 8aea3d3 commit 17696c4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 50 deletions.
50 changes: 0 additions & 50 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -5341,11 +5341,6 @@
'count' => 1,
'path' => __DIR__ . '/system/HTTP/CURLRequest.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\HTTP\\\\CURLRequest\\:\\:__construct\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/HTTP/CURLRequest.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\HTTP\\\\CURLRequest\\:\\:applyBody\\(\\) has parameter \\$curlOptions with no value type specified in iterable type array\\.$#',
'count' => 1,
Expand Down Expand Up @@ -12906,36 +12901,6 @@
'count' => 1,
'path' => __DIR__ . '/tests/system/HTTP/CLIRequestTest.php',
];
$ignoreErrors[] = [
'message' => '#^Assigning \'10\' directly on offset \'HTTP_CONTENT_LENGTH\' of \\$_SERVER is discouraged\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php',
];
$ignoreErrors[] = [
'message' => '#^Assigning \'en\\-US\' directly on offset \'HTTP_ACCEPT_LANGUAGE\' of \\$_SERVER is discouraged\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php',
];
$ignoreErrors[] = [
'message' => '#^Assigning \'gzip, deflate, br\' directly on offset \'HTTP_ACCEPT_ENCODING\' of \\$_SERVER is discouraged\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php',
];
$ignoreErrors[] = [
'message' => '#^Assigning \'site1\\.com\' directly on offset \'HTTP_HOST\' of \\$_SERVER is discouraged\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\HTTP\\\\CURLRequestDoNotShareOptionsTest\\:\\:getRequest\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php',
];
$ignoreErrors[] = [
'message' => '#^Access to an undefined property CodeIgniter\\\\HTTP\\\\CURLRequest\\:\\:\\$curl_options\\.$#',
'count' => 39,
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestTest.php',
];
$ignoreErrors[] = [
'message' => '#^Assigning \'10\' directly on offset \'HTTP_CONTENT_LENGTH\' of \\$_SERVER is discouraged\\.$#',
'count' => 1,
Expand All @@ -12956,21 +12921,6 @@
'count' => 1,
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestTest.php',
];
$ignoreErrors[] = [
'message' => '#^Call to an undefined method CodeIgniter\\\\HTTP\\\\CURLRequest\\:\\:setOutput\\(\\)\\.$#',
'count' => 4,
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestTest.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\HTTP\\\\CURLRequestTest\\:\\:getRequest\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestTest.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\HTTP\\\\CURLRequestTest\\:\\:getRequest\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#',
'count' => 1,
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestTest.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\HTTP\\\\ContentSecurityPolicyTest\\:\\:work\\(\\) has no return type specified\\.$#',
'count' => 1,
Expand Down
2 changes: 2 additions & 0 deletions system/HTTP/CURLRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ class CURLRequest extends OutgoingRequest
* - baseURI
* - timeout
* - any other request options to use as defaults.
*
* @param array<string, mixed> $options
*/
public function __construct(App $config, URI $uri, ?ResponseInterface $response = null, array $options = [])
{
Expand Down
3 changes: 3 additions & 0 deletions tests/system/HTTP/CURLRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ protected function setUp(): void
$this->request = $this->getRequest();
}

/**
* @param array<string, mixed> $options
*/
protected function getRequest(array $options = []): MockCURLRequest
{
$uri = isset($options['base_uri']) ? new URI($options['base_uri']) : new URI();
Expand Down

0 comments on commit 17696c4

Please sign in to comment.