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

SlevomatCodingStandard.Operators.DisallowEqualOperators: prevent risky fix #18

Merged
merged 1 commit into from Sep 8, 2020

Conversation

autowp
Copy link
Contributor

@autowp autowp commented Mar 12, 2020

Propose disable automatic correction for #17 because they change code behavior.

Test remain updated to check issue found but automatic fix is disabled.

The only bug is: phpcs shows phpcbf can fix the issue

<?php

var_dump(1 != '1');
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 3 | ERROR | [x] Operator != is disallowed, use !== instead.
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

@autowp
Copy link
Contributor Author

autowp commented Mar 12, 2020

Latest tests failed on some other rule

@geerteltink
Copy link
Member

To be honest, this rule is about disallowing loose comparison. If we allow loose comparison, the rule can be removed entirely.

@autowp
Copy link
Contributor Author

autowp commented Mar 13, 2020

To be honest, this rule is about disallowing loose comparison. If we allow loose comparison, the rule can be removed entirely.

No, we not allow. We warn, but not autofix. Test checks warning

@geerteltink
Copy link
Member

See #17

@geerteltink geerteltink closed this May 4, 2020
@geerteltink geerteltink reopened this Sep 7, 2020
@geerteltink geerteltink added this to the 2.1.0 milestone Sep 7, 2020
@geerteltink geerteltink self-requested a review September 8, 2020 06:33
@geerteltink geerteltink merged commit bfdfbf3 into laminas:develop Sep 8, 2020
@geerteltink geerteltink self-assigned this Sep 8, 2020
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.

None yet

2 participants