-
Notifications
You must be signed in to change notification settings - Fork 20
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
How can I disable detection of die/exit ? #35
Comments
Hi, You can find different solutions in the official documentation: If you want to disable it globally, I think you can redeclare the parameter in your project. |
Hi @mremi , Thank you for the explanation, I want to disable it globally. banned_code:
nodes:
# enable detection of a set of functions
-
type: Expr_FuncCall
functions:
- dump
- var_dump I just want to detect these functions: "dump" and "var_dump", not "exit" or "eval". Best regards, |
Hi, EDIT -> I found a solution, do not include vendor/ekino/phpstan-banned-code/extension.neon in PHPStan config and just include my own file with the same template that extension.neon (parametersSchema, parameters and services tags) Best regards, |
Hi @ValentinLorand , Thank you for providing the solution. Best regards, |
Hi, |
Thank you. Maybe I need to remove phpstan/extension-installer to solve this. |
You may use both: disable # composer.json
{
"extra": {
"phpstan/extension-installer": {
"ignore": [
"ekino/phpstan-banned-code"
]
}
}
} https://github.com/phpstan/extension-installer?tab=readme-ov-file#ignoring-a-particular-extension # phpstan.dist.neon
# do not include vendor/ekino/phpstan-banned-code/extension.neon
parametersSchema:
banned_code: structure([
nodes: listOf(structure([
type: string()
functions: schema(listOf(string()), nullable())
]))
])
services:
-
class: Ekino\PHPStanBannedCode\Rules\BannedNodesRule
tags:
- phpstan.rules.rule
arguments:
- '%banned_code.nodes%'
parameters:
banned_code:
nodes:
# enable detection of a set of functions
-
type: Expr_FuncCall
functions:
- dd
- dump |
Hi Ekino,
As the detection of die/exit is enabled by default in the extension.neon.
Is it possible to disable such detection in my project? If so, how to do it?
Best regards,
Weichao
The text was updated successfully, but these errors were encountered: