Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Add phpDoc for Filters #9446

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions system/Config/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ class Filters extends BaseConfig
*
* Example:
* 'isLoggedIn' => ['before' => ['account/*', 'profiles/*']]
*
* @var array<string, array<string, list<string>>>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about this more precise PHPDoc structure? Does it meet your expectations for clarity and accuracy, or would you prefer a simpler approach?

Suggested change
* @var array<string, array<string, list<string>>>
* @var array<string, array{before?: string[], after?: string[]}>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO simpler is better.

*/
public array $filters = [];
}
7 changes: 1 addition & 6 deletions utils/phpstan-baseline/missingType.iterableValue.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# total 1672 errors
# total 1671 errors

parameters:
ignoreErrors:
Expand Down Expand Up @@ -792,11 +792,6 @@ parameters:
count: 1
path: ../../system/Config/Factory.php

-
message: '#^Property CodeIgniter\\Config\\Filters\:\:\$filters type has no value type specified in iterable type array\.$#'
count: 1
path: ../../system/Config/Filters.php

-
message: '#^Method CodeIgniter\\Config\\Services\:\:curlrequest\(\) has parameter \$options with no value type specified in iterable type array\.$#'
count: 1
Expand Down
7 changes: 1 addition & 6 deletions utils/phpstan-baseline/property.phpDocType.neon
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# total 47 errors
# total 46 errors

parameters:
ignoreErrors:
-
message: '#^PHPDoc type array\<string, array\<string, list\<string\>\>\> of property Config\\Filters\:\:\$filters is not the same as PHPDoc type array of overridden property CodeIgniter\\Config\\Filters\:\:\$filters\.$#'
count: 1
path: ../../app/Config/Filters.php

-
message: '#^PHPDoc type string of property CodeIgniter\\Database\\MySQLi\\Connection\:\:\$escapeChar is not the same as PHPDoc type array\|string of overridden property CodeIgniter\\Database\\BaseConnection\<mysqli,mysqli_result\>\:\:\$escapeChar\.$#'
count: 1
Expand Down
Loading