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

[FEATURE] Add rector/type-perfect PHPStan rules #1599

Merged
merged 1 commit into from
Feb 19, 2025
Merged
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
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"phpstan/phpstan-phpunit": "1.4.2",
"phpstan/phpstan-strict-rules": "1.6.1",
"phpunit/phpunit": "9.6.22",
"rector/type-perfect": "1.0.0",
"saschaegerer/phpstan-typo3": "1.10.2",
"seld/jsonlint": "1.11.0",
"spaze/phpstan-disallowed-calls": "4.3.1",
Expand Down
10 changes: 10 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ parameters:
class: 10
function: 5

type_perfect:
no_mixed_property: true
no_mixed_caller: true
null_over_false: true
narrow_param: true
narrow_return: true

disallowedFunctionCalls:
-
function:
Expand All @@ -40,12 +47,14 @@ parameters:
-
function: 'header()'
message: 'Use PSR-7 API instead'

disallowedStaticCalls:
-
method:
- 'TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump()'
- 'TYPO3\CMS\Core\Utility\DebugUtility::debug()'
message: 'Use logging instead or remove if it was for debugging purposes.'

disallowedSuperglobals:
-
superglobal:
Expand All @@ -54,6 +63,7 @@ parameters:
- '$_FILES'
- '$_SERVER'
message: 'Use PSR-7 API instead'

ignoreErrors:
-
message: '#Out of 1 possible constant types#'
Expand Down
Loading