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

Unary minus value expr isn't resolved correctly in NodeExpressionResolver #114

Closed

Conversation

MaximilianKresse
Copy link
Contributor

Given code:

class Test
{
    const A = -5;

    protected $a = -5;

    public function test($a = -5)
    {}
}

All of these value cannot be parsed correctly in the current version (v3.0.1).

The values of all elements are parsed as "NULL".

The problem can be found in the NodeExpressionResolver. Negativ values are parsed as UnaryMinus with an expression inside. But at the moment there is no "resolveExprUnaryMinus" method and so these nodes are completely ignored.

The same counts for an unary plus. But in most cases you would never write an unary plus before positive numbers (at least I never did it or have seen it).

@scrutinizer-notifier
Copy link

The inspection completed: No new issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants