Skip to content

Commit c6c4f81

Browse files
committed
docs: add array types
1 parent 83be00a commit c6c4f81

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
@@ -5336,11 +5336,6 @@
53365336
'count' => 10,
53375337
'path' => __DIR__ . '/system/HTTP/CURLRequest.php',
53385338
];
5339-
$ignoreErrors[] = [
5340-
'message' => '#^Method CodeIgniter\\\\HTTP\\\\CURLRequest\\:\\:__construct\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#',
5341-
'count' => 1,
5342-
'path' => __DIR__ . '/system/HTTP/CURLRequest.php',
5343-
];
53445339
$ignoreErrors[] = [
53455340
'message' => '#^Method CodeIgniter\\\\HTTP\\\\CURLRequest\\:\\:applyBody\\(\\) has parameter \\$curlOptions with no value type specified in iterable type array\\.$#',
53465341
'count' => 1,
@@ -12901,36 +12896,6 @@
1290112896
'count' => 1,
1290212897
'path' => __DIR__ . '/tests/system/HTTP/CLIRequestTest.php',
1290312898
];
12904-
$ignoreErrors[] = [
12905-
'message' => '#^Assigning \'10\' directly on offset \'HTTP_CONTENT_LENGTH\' of \\$_SERVER is discouraged\\.$#',
12906-
'count' => 1,
12907-
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php',
12908-
];
12909-
$ignoreErrors[] = [
12910-
'message' => '#^Assigning \'en\\-US\' directly on offset \'HTTP_ACCEPT_LANGUAGE\' of \\$_SERVER is discouraged\\.$#',
12911-
'count' => 1,
12912-
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php',
12913-
];
12914-
$ignoreErrors[] = [
12915-
'message' => '#^Assigning \'gzip, deflate, br\' directly on offset \'HTTP_ACCEPT_ENCODING\' of \\$_SERVER is discouraged\\.$#',
12916-
'count' => 1,
12917-
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php',
12918-
];
12919-
$ignoreErrors[] = [
12920-
'message' => '#^Assigning \'site1\\.com\' directly on offset \'HTTP_HOST\' of \\$_SERVER is discouraged\\.$#',
12921-
'count' => 1,
12922-
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php',
12923-
];
12924-
$ignoreErrors[] = [
12925-
'message' => '#^Method CodeIgniter\\\\HTTP\\\\CURLRequestDoNotShareOptionsTest\\:\\:getRequest\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#',
12926-
'count' => 1,
12927-
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php',
12928-
];
12929-
$ignoreErrors[] = [
12930-
'message' => '#^Access to an undefined property CodeIgniter\\\\HTTP\\\\CURLRequest\\:\\:\\$curl_options\\.$#',
12931-
'count' => 39,
12932-
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestTest.php',
12933-
];
1293412899
$ignoreErrors[] = [
1293512900
'message' => '#^Assigning \'10\' directly on offset \'HTTP_CONTENT_LENGTH\' of \\$_SERVER is discouraged\\.$#',
1293612901
'count' => 1,
@@ -12951,21 +12916,6 @@
1295112916
'count' => 1,
1295212917
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestTest.php',
1295312918
];
12954-
$ignoreErrors[] = [
12955-
'message' => '#^Call to an undefined method CodeIgniter\\\\HTTP\\\\CURLRequest\\:\\:setOutput\\(\\)\\.$#',
12956-
'count' => 4,
12957-
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestTest.php',
12958-
];
12959-
$ignoreErrors[] = [
12960-
'message' => '#^Method CodeIgniter\\\\HTTP\\\\CURLRequestTest\\:\\:getRequest\\(\\) has no return type specified\\.$#',
12961-
'count' => 1,
12962-
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestTest.php',
12963-
];
12964-
$ignoreErrors[] = [
12965-
'message' => '#^Method CodeIgniter\\\\HTTP\\\\CURLRequestTest\\:\\:getRequest\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#',
12966-
'count' => 1,
12967-
'path' => __DIR__ . '/tests/system/HTTP/CURLRequestTest.php',
12968-
];
1296912919
$ignoreErrors[] = [
1297012920
'message' => '#^Method CodeIgniter\\\\HTTP\\\\ContentSecurityPolicyTest\\:\\:work\\(\\) has no return type specified\\.$#',
1297112921
'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)