not_operator_with_space.rst 772 B

1234567891011121314151617181920212223242526272829
  1. ================================
  2. Rule ``not_operator_with_space``
  3. ================================
  4. Logical NOT operators (``!``) should have leading and trailing whitespaces.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. <?php
  13. -if (!$bar) {
  14. +if ( ! $bar) {
  15. echo "Help!";
  16. }
  17. References
  18. ----------
  19. - Fixer class: `PhpCsFixer\\Fixer\\Operator\\NotOperatorWithSpaceFixer <./../../../src/Fixer/Operator/NotOperatorWithSpaceFixer.php>`_
  20. - Test class: `PhpCsFixer\\Tests\\Fixer\\Operator\\NotOperatorWithSpaceFixerTest <./../../../tests/Fixer/Operator/NotOperatorWithSpaceFixerTest.php>`_
  21. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.