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

Bug fix: false negative unused var #120

Commits on Jan 20, 2020

  1. Bug fix: false negative unused var

    As reported in 111, if a variable is assigned a value with a combined assignment operator, it would not be reported as unused.
    
    Includes unit tests.
    
    Fixes 111
    jrfnl committed Jan 20, 2020
    Configuration menu
    Copy the full SHA
    a95ad2c View commit details
    Browse the repository at this point in the history
  2. PHPStan config: don't report unmatched errors

    Now the `PHP_CodeSniffer\Util\Tokens` file is imported, the `Constant T_\w+ not found` errors should no longer be thrown.
    
    However, it depends on the order in which the files are analysed as that file is not (yet) `use`d in all files using the `T_` constants.
    
    If I remove the `ignoreErrors`, [the build fails](https://circleci.com/gh/sirbrillig/phpcs-variable-analysis/281) on those errors for the `VariableAnalysisSniff` file, while if I leave the exclusion in, [the build fails](https://circleci.com/gh/sirbrillig/phpcs-variable-analysis/283) on a "Ignored error not matched".
    
    So, for now, I'm leaving the ignore pattern in place and turning `reportUnmatchedIgnoredErrors` off to allow the build to pass.
    jrfnl committed Jan 20, 2020
    Configuration menu
    Copy the full SHA
    a568169 View commit details
    Browse the repository at this point in the history