Update ValidFunctionNames
Sniff to allow for non-valid names in extended classes.
#623
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #507
This allows for classes which extend a parent class or implement an interface to use method names which do not comply with the "don't start methods with a double underscore" and snake case rules so they can overload parent methods without an issue being raised.
This was previously already implemented for snake case, but not for double underscore.
I've also synced the class with the parent class it uses and applied any relevant changes to the overloaded methods and removed some code which can defer to the parent.
Also:
Please see the individual commits for more details.
There was one change in the parent class - which I have implemented -, which I was not sure about as it changes the result of one unit test.
Basically, before, function names (outside class scope) were allowed to start with a double underscore.
The change in the parent does allow for methods where the name only consists of underscores, like __(), but does not allow function names which also contain other characters to start with a double underscore unless they are a PHP magic function name, i.e.
__autoload()
.