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

NTR: add disallowed function checks to phpstan #645

Merged
merged 1 commit into from
Oct 24, 2023
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
15 changes: 15 additions & 0 deletions .phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,22 @@ parameters:
# legacy code that is not working with abstract/interface changes
- ./src/Compatibility/Storefront/Route/PaymentMethodRoute/RemovePaymentMethodRoute63.php
- ./src/Service/Mail/MailService63.php
disallowedFunctionCalls:
- function: 'var_dump()'
message: 'use some logger instead'
- function: 'var_export()'
message: 'use some logger instead'
- function: 'dd()'
message: 'use some logger instead'
- function: 'print_r()'
message: 'use some logger instead'
- function: 'putenv()'
message: 'might overwrite existing variables'

services:
- class: MolliePayments\PHPStan\Rules\NoManufacturerRule
tags:
- phpstan.rules.rule

includes:
- vendor/spaze/phpstan-disallowed-calls/extension.neon
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"phpstan/phpstan": "1.8.2",
"phpstan/phpstan": "1.10.0",
"friendsofphp/php-cs-fixer": "^2.18",
"phpcompatibility/php-compatibility": "^9.3",
"squizlabs/php_codesniffer": "^3.6",
"infection/infection": "^0.25.4",
"boxblinkracer/phpunuhi": "dev-main",
"spaze/phpstan-disallowed-calls": "^2.16",
"shopware/core": "*",
"shopware/administration": "*",
"shopware/storefront": "*"
Expand Down
Loading
Loading