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

Do not treat negated constant as a magic number #4

Merged
merged 1 commit into from
Apr 25, 2023

Conversation

maks-rafalko
Copy link
Contributor

Do not treat negated constant as a magic number

return -self::CONST

is not a magic number.

Additionally, correctly handle UnaryPlus as well as UnaryMinus and add more tests for different combinations of + and - with constants and raw values.

```php
return -self::CONST
```

is not a magic number.

Additionally, correctly handle `UnaryPlus` as well as `UnaryMinus` and add more tests for different combinations of `+` and `-` with constants and raw values.
Copy link
Owner

@sidz sidz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch. 👍

@sidz sidz merged commit 50c7d97 into sidz:main Apr 25, 2023
@maks-rafalko maks-rafalko deleted the bugfix/unary-minus branch April 25, 2023 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants