Skip to content

Commit 6546018

Browse files
authored
Merge pull request #8654 from kenjis/fix-phpdoc-filters
docs: fix PHPDoc types for Filters
2 parents f82dc32 + 6bde439 commit 6546018

File tree

9 files changed

+17
-77
lines changed

9 files changed

+17
-77
lines changed

phpstan-baseline.php

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -5766,36 +5766,6 @@
57665766
'count' => 3,
57675767
'path' => __DIR__ . '/system/Files/File.php',
57685768
];
5769-
$ignoreErrors[] = [
5770-
'message' => '#^Method CodeIgniter\\\\Filters\\\\CSRF\\:\\:after\\(\\) has parameter \\$arguments with no value type specified in iterable type array\\.$#',
5771-
'count' => 1,
5772-
'path' => __DIR__ . '/system/Filters/CSRF.php',
5773-
];
5774-
$ignoreErrors[] = [
5775-
'message' => '#^Method CodeIgniter\\\\Filters\\\\CSRF\\:\\:before\\(\\) has parameter \\$arguments with no value type specified in iterable type array\\.$#',
5776-
'count' => 1,
5777-
'path' => __DIR__ . '/system/Filters/CSRF.php',
5778-
];
5779-
$ignoreErrors[] = [
5780-
'message' => '#^Method CodeIgniter\\\\Filters\\\\DebugToolbar\\:\\:after\\(\\) has parameter \\$arguments with no value type specified in iterable type array\\.$#',
5781-
'count' => 1,
5782-
'path' => __DIR__ . '/system/Filters/DebugToolbar.php',
5783-
];
5784-
$ignoreErrors[] = [
5785-
'message' => '#^Method CodeIgniter\\\\Filters\\\\DebugToolbar\\:\\:before\\(\\) has parameter \\$arguments with no value type specified in iterable type array\\.$#',
5786-
'count' => 1,
5787-
'path' => __DIR__ . '/system/Filters/DebugToolbar.php',
5788-
];
5789-
$ignoreErrors[] = [
5790-
'message' => '#^Method CodeIgniter\\\\Filters\\\\FilterInterface\\:\\:after\\(\\) has parameter \\$arguments with no value type specified in iterable type array\\.$#',
5791-
'count' => 1,
5792-
'path' => __DIR__ . '/system/Filters/FilterInterface.php',
5793-
];
5794-
$ignoreErrors[] = [
5795-
'message' => '#^Method CodeIgniter\\\\Filters\\\\FilterInterface\\:\\:before\\(\\) has parameter \\$arguments with no value type specified in iterable type array\\.$#',
5796-
'count' => 1,
5797-
'path' => __DIR__ . '/system/Filters/FilterInterface.php',
5798-
];
57995769
$ignoreErrors[] = [
58005770
'message' => '#^Argument \\#1 \\$name \\(\'Config\\\\\\\\Modules\'\\) passed to function config does not extend CodeIgniter\\\\\\\\Config\\\\\\\\BaseConfig\\.$#',
58015771
'count' => 1,
@@ -5861,26 +5831,6 @@
58615831
'count' => 1,
58625832
'path' => __DIR__ . '/system/Filters/Filters.php',
58635833
];
5864-
$ignoreErrors[] = [
5865-
'message' => '#^Method CodeIgniter\\\\Filters\\\\Honeypot\\:\\:after\\(\\) has parameter \\$arguments with no value type specified in iterable type array\\.$#',
5866-
'count' => 1,
5867-
'path' => __DIR__ . '/system/Filters/Honeypot.php',
5868-
];
5869-
$ignoreErrors[] = [
5870-
'message' => '#^Method CodeIgniter\\\\Filters\\\\Honeypot\\:\\:before\\(\\) has parameter \\$arguments with no value type specified in iterable type array\\.$#',
5871-
'count' => 1,
5872-
'path' => __DIR__ . '/system/Filters/Honeypot.php',
5873-
];
5874-
$ignoreErrors[] = [
5875-
'message' => '#^Method CodeIgniter\\\\Filters\\\\InvalidChars\\:\\:after\\(\\) has parameter \\$arguments with no value type specified in iterable type array\\.$#',
5876-
'count' => 1,
5877-
'path' => __DIR__ . '/system/Filters/InvalidChars.php',
5878-
];
5879-
$ignoreErrors[] = [
5880-
'message' => '#^Method CodeIgniter\\\\Filters\\\\InvalidChars\\:\\:before\\(\\) has parameter \\$arguments with no value type specified in iterable type array\\.$#',
5881-
'count' => 1,
5882-
'path' => __DIR__ . '/system/Filters/InvalidChars.php',
5883-
];
58845834
$ignoreErrors[] = [
58855835
'message' => '#^Method CodeIgniter\\\\Filters\\\\InvalidChars\\:\\:checkControl\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#',
58865836
'count' => 1,
@@ -5901,16 +5851,6 @@
59015851
'count' => 1,
59025852
'path' => __DIR__ . '/system/Filters/InvalidChars.php',
59035853
];
5904-
$ignoreErrors[] = [
5905-
'message' => '#^Method CodeIgniter\\\\Filters\\\\SecureHeaders\\:\\:after\\(\\) has parameter \\$arguments with no value type specified in iterable type array\\.$#',
5906-
'count' => 1,
5907-
'path' => __DIR__ . '/system/Filters/SecureHeaders.php',
5908-
];
5909-
$ignoreErrors[] = [
5910-
'message' => '#^Method CodeIgniter\\\\Filters\\\\SecureHeaders\\:\\:before\\(\\) has parameter \\$arguments with no value type specified in iterable type array\\.$#',
5911-
'count' => 1,
5912-
'path' => __DIR__ . '/system/Filters/SecureHeaders.php',
5913-
];
59145854
$ignoreErrors[] = [
59155855
'message' => '#^Method CodeIgniter\\\\Format\\\\FormatterInterface\\:\\:format\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#',
59165856
'count' => 1,

system/Filters/CSRF.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class CSRF implements FilterInterface
3838
* sent back to the client, allowing for error pages,
3939
* redirects, etc.
4040
*
41-
* @param array|null $arguments
41+
* @param list<string>|null $arguments
4242
*
4343
* @return RedirectResponse|void
4444
*
@@ -66,7 +66,7 @@ public function before(RequestInterface $request, $arguments = null)
6666
/**
6767
* We don't have anything to do here.
6868
*
69-
* @param array|null $arguments
69+
* @param list<string>|null $arguments
7070
*
7171
* @return void
7272
*/

system/Filters/DebugToolbar.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class DebugToolbar implements FilterInterface
2525
/**
2626
* We don't need to do anything here.
2727
*
28-
* @param array|null $arguments
28+
* @param list<string>|null $arguments
2929
*/
3030
public function before(RequestInterface $request, $arguments = null)
3131
{
@@ -35,7 +35,7 @@ public function before(RequestInterface $request, $arguments = null)
3535
* If the debug flag is set (CI_DEBUG) then collect performance
3636
* and debug information and display it in a toolbar.
3737
*
38-
* @param array|null $arguments
38+
* @param list<string>|null $arguments
3939
*/
4040
public function after(RequestInterface $request, ResponseInterface $response, $arguments = null)
4141
{

system/Filters/FilterInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ interface FilterInterface
2929
* sent back to the client, allowing for error pages,
3030
* redirects, etc.
3131
*
32-
* @param array|null $arguments
32+
* @param list<string>|null $arguments
3333
*
3434
* @return RequestInterface|ResponseInterface|string|void
3535
*/
@@ -41,7 +41,7 @@ public function before(RequestInterface $request, $arguments = null);
4141
* to stop execution of other after filters, short of
4242
* throwing an Exception or Error.
4343
*
44-
* @param array|null $arguments
44+
* @param list<string>|null $arguments
4545
*
4646
* @return ResponseInterface|void
4747
*/

system/Filters/Filters.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class Filters
9494
/**
9595
* Any arguments to be passed to filtersClass.
9696
*
97-
* @var array<class-string, array<string, list<string>>|null> [classname => arguments]
97+
* @var array<class-string, list<string>|null> [classname => arguments]
9898
*/
9999
protected $argumentsClass = [];
100100

system/Filters/Honeypot.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Honeypot implements FilterInterface
2828
* Checks if Honeypot field is empty, if not then the
2929
* requester is a bot
3030
*
31-
* @param array|null $arguments
31+
* @param list<string>|null $arguments
3232
*
3333
* @throws HoneypotException
3434
*/
@@ -46,7 +46,7 @@ public function before(RequestInterface $request, $arguments = null)
4646
/**
4747
* Attach a honeypot to the current response.
4848
*
49-
* @param array|null $arguments
49+
* @param list<string>|null $arguments
5050
*/
5151
public function after(RequestInterface $request, ResponseInterface $response, $arguments = null)
5252
{

system/Filters/InvalidChars.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class InvalidChars implements FilterInterface
4545
/**
4646
* Check invalid characters.
4747
*
48-
* @param array|null $arguments
48+
* @param list<string>|null $arguments
4949
*
5050
* @return void
5151
*/
@@ -72,7 +72,7 @@ public function before(RequestInterface $request, $arguments = null)
7272
/**
7373
* We don't have anything to do here.
7474
*
75-
* @param array|null $arguments
75+
* @param list<string>|null $arguments
7676
*
7777
* @return void
7878
*/

system/Filters/SecureHeaders.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class SecureHeaders implements FilterInterface
4949
/**
5050
* We don't have anything to do here.
5151
*
52-
* @param array|null $arguments
52+
* @param list<string>|null $arguments
5353
*
5454
* @return void
5555
*/
@@ -60,7 +60,7 @@ public function before(RequestInterface $request, $arguments = null)
6060
/**
6161
* Add security headers.
6262
*
63-
* @param array|null $arguments
63+
* @param list<string>|null $arguments
6464
*
6565
* @return void
6666
*/

user_guide_src/source/libraries/throttler/002.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ class Throttle implements FilterInterface
1313
* This is a demo implementation of using the Throttler class
1414
* to implement rate limiting for your application.
1515
*
16-
* @param array|null $arguments
16+
* @param list<string>|null $arguments
1717
*
18-
* @return mixed
18+
* @return ResponseInterface|void
1919
*/
2020
public function before(RequestInterface $request, $arguments = null)
2121
{
@@ -31,9 +31,9 @@ public function before(RequestInterface $request, $arguments = null)
3131
/**
3232
* We don't have anything to do here.
3333
*
34-
* @param array|null $arguments
34+
* @param list<string>|null $arguments
3535
*
36-
* @return mixed
36+
* @return void
3737
*/
3838
public function after(RequestInterface $request, ResponseInterface $response, $arguments = null)
3939
{

0 commit comments

Comments
 (0)