You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 01e271d
Browse filesBrowse the repository at this point in the historyBrowse files
Skip UnusedMethodParametersRule for private methods referenced as callables within their class
- A private method handed out as a callable is called from outside the class
with every argument, so its signature is a contract like a public method's.
- Before reporting, the rule scans the declaring class-like AST (via the cached
`defaultAnalysisParser`) for a first-class callable (`self::m(...)`,
`static::m(...)`, `$this->m(...)`), a callable array (`[self::class, 'm']`,
`[$this, 'm']`, also inside `Closure::fromCallable()`) or a callable string
(`'self::m'`, `'Foo::m'`). Names match case-insensitively.
- For trait methods, both the using class and the trait itself are scanned.
Anonymous classes are matched by their start line.
- The scan runs only when there would be an error to report, so methods with
no unused parameters cost nothing extra.
- Probed nullsafe first-class callables: PHP does not allow them, so they are
not handled. `UnusedFunctionParametersRule` already reports global functions
whatever their visibility, so it was left alone.
0 commit comments