Skip to content

Fix removing 0 when on left side of Minus#2308

Merged
TomasVotruba merged 2 commits intorectorphp:masterfrom
jeroensmit:zero-minus
Nov 11, 2019
Merged

Fix removing 0 when on left side of Minus#2308
TomasVotruba merged 2 commits intorectorphp:masterfrom
jeroensmit:zero-minus

Conversation

@jeroensmit
Copy link
Copy Markdown
Contributor

No description provided.

{
public function run(int $value)
{
$value = 0 - $value;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't this be:

$value = -$value;

?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You're right, PR updated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

{
public function run(int $value)
{
$value = 0 - $value;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

@TomasVotruba TomasVotruba merged commit 1aa5af7 into rectorphp:master Nov 11, 2019
TomasVotruba added a commit that referenced this pull request May 14, 2022
rectorphp/rector-src@fcb2dc6 [CodeQuality] Do not duplicate Expr on SimplifyIfElseToTernaryRector+SimplifyUselessVariableRector+CompleteDynamicPropertiesRector (#2308)
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