Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generic/UnusedFunctionParameter: ignore class context for closures/ar…
…row functions As things were, if a closure or arrow function declared within a class which extends or implements would have an unused function parameter, it would get the `InExtendedClass` or `InImplementedInterface` addition in the error code. Those additions were only intended for function declarations where the declaration would potentially be overloading a method from a parent and would have to comply with the method signature of the method in the parent class/interface. This could lead to underreporting if a standard explicitly excludes the error codes contain `InExtendedClass` and/or `InImplementedInterface`. Fixed now. Includes additional unit test, though the tests don't safeguard this much as they don't check the error codes of the messages thrown. The change can be tested manually by running the new tests against `master`, which will show: ``` 163 | WARNING | The method parameter $d is never used (Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed) 172 | WARNING | The method parameter $d is never used | | (Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterfaceAfterLastUsed) ``` ... while with the change in this commit, this will be fixed to: ``` 163 | WARNING | The method parameter $d is never used (Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed) 172 | WARNING | The method parameter $d is never used (Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed) ```
- Loading branch information