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

Type in IfStatementAssignment violation message #655

Closed
Jir4 opened this issue Aug 8, 2019 · 0 comments · Fixed by #657
Closed

Type in IfStatementAssignment violation message #655

Jir4 opened this issue Aug 8, 2019 · 0 comments · Fixed by #657
Labels
Bug Good first issue If you want to help, this may be a good start
Milestone

Comments

@Jir4
Copy link
Contributor

Jir4 commented Aug 8, 2019

  • PHPMD version: 2.7.0

Current Behavior

Got :
Avoid assigning values to variables in if clauses and the like (line '38', column '78').

Expected Behavior

Got:
Avoid assigning values to variables in if clauses and the like (line '78', column '38').

Steps To Reproduce:

Raise a IfStatementAssignment violation

As seen here :

message="Avoid assigning values to variables in if clauses and the like (line '{0}', column '{1}')."
the line is displayed first, the column second.

Here:

$this->addViolation($node, array($assignment->getStartColumn(), $assignment->getStartLine()));
we are doing the opposite

I don't really if we are supposed the fix the message or the code

@kylekatarnls kylekatarnls added this to the 2.7.1 milestone Aug 8, 2019
@kylekatarnls kylekatarnls added the Good first issue If you want to help, this may be a good start label Aug 8, 2019
@kylekatarnls kylekatarnls modified the milestones: 2.7.1, 2.8.0 Oct 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Good first issue If you want to help, this may be a good start
Development

Successfully merging a pull request may close this issue.

2 participants