Originally posted by **eithed** December 19, 2022
I'd like to disallow different methods, with different messages, dependent upon the number of parameters used. For example, if I've got function:
```
function foo($bar = '', $xyz = ''){}
```
I'd like to display:
- if `foo()` is used anywhere, display `Don't use foo`
- if `foo(*)` is used anywhere, display `Don't use foo with parameter $bar`
- if `foo(*,*)` is used anywhere, display `Don't use foo with parameters $bar and $xyz`
Is this possible at all?
Maintainer note: I think a param-level message could be added that would override the main message when a call would be disallowed due to disallowed/missing param.
Discussed in https://github.com/spaze/phpstan-disallowed-calls/discussions/154
Maintainer note: I think a param-level message could be added that would override the main message when a call would be disallowed due to disallowed/missing param.