single_line_throw.rst 447 B

123456789101112131415161718192021222324252627282930
  1. ==========================
  2. Rule ``single_line_throw``
  3. ==========================
  4. Throwing exception must be done in single line.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. <?php
  13. -throw new Exception(
  14. - 'Error.',
  15. - 500
  16. -);
  17. +throw new Exception('Error.', 500);
  18. Rule sets
  19. ---------
  20. The rule is part of the following rule set:
  21. - `@Symfony <./../../ruleSets/Symfony.rst>`_