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

Fix File::isReference() method #1609

Commits on Aug 15, 2017

  1. Add unit tests for the File::isReference() method

    A number of these will currently fail.
    jrfnl committed Aug 15, 2017
    Configuration menu
    Copy the full SHA
    d54ffca View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d0cdbda View commit details
    Browse the repository at this point in the history
  3. File::getMethodParameters(): Fix underlying issue of pass by refere…

    …nce not being identified correctly
    
    Since PHP 5.6, default values in function declarations can contain constant expressions.
    These expressions can contain a `T_BITWISE_AND`, but the `File::getMethodParameters()` method did not account for this and would misidentify the `T_BITWISE_AND` as indicating that the variable was being passed by reference.
    
    Includes a new unit test for the `File::getMethodParameters()` method to specifically safeguard against this issue.
    jrfnl committed Aug 15, 2017
    Configuration menu
    Copy the full SHA
    611d868 View commit details
    Browse the repository at this point in the history
  4. Fix File::isReference() method

    The `File:isReference()` method misidentified a number of situations where the `T_BITWISE_AND` token was encountered, most notably:
    * An array assignment of a calculated value with a bitwise and operator in it ,was being misidentified as a reference.
    * A calculated default value for a function parameter with a bitwise and operator in it, was being misidentified as a reference.
    * New by reference was not recognized as a reference.
    * References to class properties with `self::`, `parent::`, `static::`, `namespace\Class::`, `classname::` were not recognized as references.
    
    This commit fixes these cases.
    
    Fixes 1604
    jrfnl committed Aug 15, 2017
    Configuration menu
    Copy the full SHA
    badc598 View commit details
    Browse the repository at this point in the history