Skip to content

Commit

Permalink
NTR: add disallowed function checks to phpstan (#645)
Browse files Browse the repository at this point in the history
  • Loading branch information
boxblinkracer authored Oct 24, 2023
1 parent 76c8123 commit 2016ee4
Show file tree
Hide file tree
Showing 3 changed files with 217 additions and 60 deletions.
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

0 comments on commit 2016ee4

Please sign in to comment.