-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generic/LowerCaseType: fix potential PHP notice
The `Generic.PHP.LowerCaseType` sniff calls the `File::getMemberProperties()` method to get information about potential properties. That method throws an exception when the `T_VARIABLE` token passed is not a property, but will create an `Internal.ParseError.InterfaceHasMemberVar` warning and return an empty array when the `T_VARIABLE` passed is an _illegal_ property, i.e. a property in a context in which it is not allowed (interface/enum). As things were, the sniff did not take a potential return value of an empty array into account, which could result in an `Undefined array key "type"` PHP notice. Fixed now. Includes unit test.
- Loading branch information
Showing
4 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters