-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Allow print_r(..., true) #1
Comments
Hi, thanks. I'd love to allow some "forbidden calls" with specified parameters but I'd like it to be more generic and configurable. For example What I do now, until support for params is added, I just simply ignore the error:
To not have to ignore the error in many files, a logger that would accept any type and |
Thinking out loud here (may server as a note to self or to anyone willing to implement it) but something this is what I'd like to see: The arguments:
forbiddenCalls:
-
function: 'print_r()'
message: 'use logger instead'
allowedParams:
2:
type: boolean
value: true |
I've added |
Works perfect for me. Thanks. |
Which throw: ``` 68 Parameter #1 $identifiers of method Spaze\PHPStan\Rules\Disallowed\Formatter\Formatter::formatIdentifier() expects list<string>, non-empty-array given. ``` And the `non-empty-list` is just because that's what it is.
This is a new bleeding edge rule added in PHPStan 1.10.59 which resulted in "Parameter #1 $array (non-empty-list<string>) of array_values is already a list, call has no effect."
This is a new bleeding edge rule added in PHPStan 1.10.59 which resulted in "Parameter #1 $array (non-empty-list<string>) of array_values is already a list, call has no effect."
Hello, would you mind to allow
print_r()
with$return = true
argument?We are using it quite often for a better format in logs.
I mean something like (
print_r()
specific):https://github.com/spaze/phpstan-disallowed-calls/blob/master/src/FunctionCalls.php#L61 :
Thanks.
The text was updated successfully, but these errors were encountered: