combine_consecutive_issets.rst 938 B

12345678910111213141516171819202122232425262728293031323334
  1. ===================================
  2. Rule ``combine_consecutive_issets``
  3. ===================================
  4. Using ``isset($var) &&`` multiple times should be done in one call.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. <?php
  13. -$a = isset($a) && isset($b);
  14. +$a = isset($a, $b) ;
  15. Rule sets
  16. ---------
  17. The rule is part of the following rule set:
  18. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  19. References
  20. ----------
  21. - Fixer class: `PhpCsFixer\\Fixer\\LanguageConstruct\\CombineConsecutiveIssetsFixer <./../../../src/Fixer/LanguageConstruct/CombineConsecutiveIssetsFixer.php>`_
  22. - Test class: `PhpCsFixer\\Tests\\Fixer\\LanguageConstruct\\CombineConsecutiveIssetsFixerTest <./../../../tests/Fixer/LanguageConstruct/CombineConsecutiveIssetsFixerTest.php>`_
  23. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.