fopen_flag_order.rst 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. =========================
  2. Rule ``fopen_flag_order``
  3. =========================
  4. Order the flags in ``fopen`` calls, ``b`` and ``t`` must be last.
  5. Warning
  6. -------
  7. Using this rule is risky
  8. ~~~~~~~~~~~~~~~~~~~~~~~~
  9. Risky when the function ``fopen`` is overridden.
  10. Examples
  11. --------
  12. Example #1
  13. ~~~~~~~~~~
  14. .. code-block:: diff
  15. --- Original
  16. +++ New
  17. <?php
  18. -$a = fopen($foo, 'br+');
  19. +$a = fopen($foo, 'r+b');
  20. Rule sets
  21. ---------
  22. The rule is part of the following rule sets:
  23. - `@PhpCsFixer:risky <./../../ruleSets/PhpCsFixerRisky.rst>`_
  24. - `@Symfony:risky <./../../ruleSets/SymfonyRisky.rst>`_
  25. References
  26. ----------
  27. - Fixer class: `PhpCsFixer\\Fixer\\FunctionNotation\\FopenFlagOrderFixer <./../../../src/Fixer/FunctionNotation/FopenFlagOrderFixer.php>`_
  28. - Test class: `PhpCsFixer\\Tests\\Fixer\\FunctionNotation\\FopenFlagOrderFixerTest <./../../../tests/Fixer/FunctionNotation/FopenFlagOrderFixerTest.php>`_
  29. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.