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

Tests: add dedicated test for the SyntaxError::translateTokens() method + edge case bug fix #117

Merged
merged 2 commits into from
Apr 19, 2022

Commits on Apr 8, 2022

  1. Tests: add dedicated test for the SyntaxError::translateTokens() me…

    …thod
    
    This safeguards and documents the current behaviour of the method.
    jrfnl committed Apr 8, 2022
    Configuration menu
    Copy the full SHA
    a6e5237 View commit details
    Browse the repository at this point in the history
  2. SyntaxError::translateTokens(): prevent double translation

    Generally speaking, the `$translate` parameter for the `SyntaxError::getNormalizedMessage()` method should only be passed as `true` when on a PHP version which doesn't do the PHP native token translation yet.
    
    However, in edge cases, it could be possible that tokens could be double "translated", both by PHP itself as well as by the `SyntaxError::translateTokens()` method.
    
    This minor fix prevents this by not matching token names when surrounded by parentheses.
    
    Includes additional unit tests.
    jrfnl committed Apr 8, 2022
    Configuration menu
    Copy the full SHA
    2c1f747 View commit details
    Browse the repository at this point in the history