strict_comparison.rst 543 B

1234567891011121314151617181920212223242526272829303132
  1. ==========================
  2. Rule ``strict_comparison``
  3. ==========================
  4. Comparisons should be strict.
  5. .. warning:: Using this rule is risky.
  6. Changing comparisons to strict might change code behavior.
  7. Examples
  8. --------
  9. Example #1
  10. ~~~~~~~~~~
  11. .. code-block:: diff
  12. --- Original
  13. +++ New
  14. @@ -1,2 +1,2 @@
  15. <?php
  16. -$a = 1== $b;
  17. +$a = 1=== $b;
  18. Rule sets
  19. ---------
  20. The rule is part of the following rule set:
  21. @PhpCsFixer:risky
  22. Using the ``@PhpCsFixer:risky`` rule set will enable the ``strict_comparison`` rule.