Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic/LowerCaseType: fix potential PHP notice #3833

Closed
wants to merge 1 commit into from

Commits on May 22, 2023

  1. 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.
    jrfnl committed May 22, 2023
    Configuration menu
    Copy the full SHA
    adc209d View commit details
    Browse the repository at this point in the history