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

Parentheses: recognize more parentheses owners #215

Merged
merged 1 commit into from
Sep 20, 2020

Commits on Sep 20, 2020

  1. Parentheses: recognize more parentheses owners

    PHPCS natively does not consider `isset()`, `unset()`, `empty()`, `exit()`, `die()` and `eval()` as parentheses owners.
    
    As of now, the methods in the PHPCSUtils `Parentheses` class will.
    
    If effect, this means you can now check whether an arbitrary token is within an `isset()`, `unset()` or `empty()` call by calling:
    ```php
    if (Parentheses::hasOwner($phpcsFile, $stackPtr, [\T_ISSET, \T_UNSET, \T_EMPTY]) !== false) {
        // Do something.
    }
    ```
    
    Related issue upstream: squizlabs/PHP_CodeSniffer#3118
    jrfnl committed Sep 20, 2020
    Configuration menu
    Copy the full SHA
    00c1206 View commit details
    Browse the repository at this point in the history