issue_7293.test 758 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. --TEST--
  2. Integration of several fixers related to curly braces, empty lines and trailing whitespace.
  3. --RULESET--
  4. {
  5. "blank_line_before_statement": true,
  6. "no_extra_blank_lines": {"tokens": ["curly_brace_block"]},
  7. "no_useless_else": true,
  8. "no_trailing_whitespace": true,
  9. "no_whitespace_in_blank_line": true,
  10. "statement_indentation": true
  11. }
  12. --EXPECT--
  13. <?php
  14. function foo()
  15. {
  16. if (f1()) {
  17. if (f2()) {
  18. return 1;
  19. }
  20. return 2;
  21. } elseif (f3()) {
  22. return 3;
  23. }
  24. f4();
  25. }
  26. --INPUT--
  27. <?php
  28. function foo()
  29. {
  30. if (f1()) {
  31. if (f2()) {
  32. return 1;
  33. } else {
  34. return 2;
  35. }
  36. } elseif (f3()) {
  37. return 3;
  38. } else {
  39. f4();
  40. }
  41. }