Skip to content

Commit c40410f

Browse files
committed
docs: add array types
1 parent bb564e8 commit c40410f

File tree

3 files changed

+5
-50
lines changed

3 files changed

+5
-50
lines changed

phpstan-baseline.php

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -5341,11 +5341,6 @@
53415341
'count' => 1,
53425342
'path' => __DIR__ . '/system/HTTP/CURLRequest.php',
53435343
];
5344-
$ignoreErrors[] = [
5345-
'message' => '#^Method CodeIgniter\\\\HTTP\\\\CURLRequest\\:\\:__construct\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#',
5346-
'count' => 1,
5347-
'path' => __DIR__ . '/system/HTTP/CURLRequest.php',
5348-
];
53495344
$ignoreErrors[] = [
53505345
'message' => '#^Method CodeIgniter\\\\HTTP\\\\CURLRequest\\:\\:applyBody\\(\\) has parameter \\$curlOptions with no value type specified in iterable type array\\.$#',
53515346
'count' => 1,
@@ -12906,36 +12901,6 @@
1290612901
'count' => 1,
1290712902
'path' => __DIR__ . '/tests/system/HTTP/CLIRequestTest.php',
1290812903
];
12909-
$ignoreErrors[] = [
12910-
'message' => '#^Assigning \'10\' directly on offset \'HTTP_CONTENT_LENGTH\' of \\$_SERVER is discouraged\\.$#',
12911-
'count' => 1,
12912-
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php',
12913-
];
12914-
$ignoreErrors[] = [
12915-
'message' => '#^Assigning \'en\\-US\' directly on offset \'HTTP_ACCEPT_LANGUAGE\' of \\$_SERVER is discouraged\\.$#',
12916-
'count' => 1,
12917-
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php',
12918-
];
12919-
$ignoreErrors[] = [
12920-
'message' => '#^Assigning \'gzip, deflate, br\' directly on offset \'HTTP_ACCEPT_ENCODING\' of \\$_SERVER is discouraged\\.$#',
12921-
'count' => 1,
12922-
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php',
12923-
];
12924-
$ignoreErrors[] = [
12925-
'message' => '#^Assigning \'site1\\.com\' directly on offset \'HTTP_HOST\' of \\$_SERVER is discouraged\\.$#',
12926-
'count' => 1,
12927-
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php',
12928-
];
12929-
$ignoreErrors[] = [
12930-
'message' => '#^Method CodeIgniter\\\\HTTP\\\\CURLRequestDoNotShareOptionsTest\\:\\:getRequest\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#',
12931-
'count' => 1,
12932-
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php',
12933-
];
12934-
$ignoreErrors[] = [
12935-
'message' => '#^Access to an undefined property CodeIgniter\\\\HTTP\\\\CURLRequest\\:\\:\\$curl_options\\.$#',
12936-
'count' => 39,
12937-
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestTest.php',
12938-
];
1293912904
$ignoreErrors[] = [
1294012905
'message' => '#^Assigning \'10\' directly on offset \'HTTP_CONTENT_LENGTH\' of \\$_SERVER is discouraged\\.$#',
1294112906
'count' => 1,
@@ -12956,21 +12921,6 @@
1295612921
'count' => 1,
1295712922
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestTest.php',
1295812923
];
12959-
$ignoreErrors[] = [
12960-
'message' => '#^Call to an undefined method CodeIgniter\\\\HTTP\\\\CURLRequest\\:\\:setOutput\\(\\)\\.$#',
12961-
'count' => 4,
12962-
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestTest.php',
12963-
];
12964-
$ignoreErrors[] = [
12965-
'message' => '#^Method CodeIgniter\\\\HTTP\\\\CURLRequestTest\\:\\:getRequest\\(\\) has no return type specified\\.$#',
12966-
'count' => 1,
12967-
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestTest.php',
12968-
];
12969-
$ignoreErrors[] = [
12970-
'message' => '#^Method CodeIgniter\\\\HTTP\\\\CURLRequestTest\\:\\:getRequest\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#',
12971-
'count' => 1,
12972-
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestTest.php',
12973-
];
1297412924
$ignoreErrors[] = [
1297512925
'message' => '#^Method CodeIgniter\\\\HTTP\\\\ContentSecurityPolicyTest\\:\\:work\\(\\) has no return type specified\\.$#',
1297612926
'count' => 1,

system/HTTP/CURLRequest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ class CURLRequest extends OutgoingRequest
107107
* - baseURI
108108
* - timeout
109109
* - any other request options to use as defaults.
110+
*
111+
* @param array<string, mixed> $options
110112
*/
111113
public function __construct(App $config, URI $uri, ?ResponseInterface $response = null, array $options = [])
112114
{

tests/system/HTTP/CURLRequestTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ protected function setUp(): void
4141
$this->request = $this->getRequest();
4242
}
4343

44+
/**
45+
* @param array<string, mixed> $options
46+
*/
4447
protected function getRequest(array $options = []): MockCURLRequest
4548
{
4649
$uri = isset($options['base_uri']) ? new URI($options['base_uri']) : new URI();

0 commit comments

Comments
 (0)