From a5397897e3a80eff0801b5778bc6b18a9ecedd90 Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Fri, 30 Nov 2018 12:50:56 -0200 Subject: [PATCH] Add sniff to forbid multiple lines between functions --- lib/Doctrine/ruleset.xml | 8 ++++++++ tests/expected_report.txt | 8 ++++---- tests/input/example-class.php | 2 ++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/ruleset.xml b/lib/Doctrine/ruleset.xml index d8656ccd..d9fdd342 100644 --- a/lib/Doctrine/ruleset.xml +++ b/lib/Doctrine/ruleset.xml @@ -444,6 +444,14 @@ + + + + + + + + diff --git a/tests/expected_report.txt b/tests/expected_report.txt index 96ecbda6..1bcf95db 100644 --- a/tests/expected_report.txt +++ b/tests/expected_report.txt @@ -10,7 +10,7 @@ tests/input/concatenation_spacing.php 24 0 tests/input/constants-var.php 3 0 tests/input/doc-comment-spacing.php 10 0 tests/input/EarlyReturn.php 5 0 -tests/input/example-class.php 28 0 +tests/input/example-class.php 29 0 tests/input/forbidden-comments.php 4 0 tests/input/forbidden-functions.php 6 0 tests/input/LowCaseTypes.php 2 0 @@ -24,13 +24,13 @@ tests/input/return_type_on_methods.php 17 0 tests/input/semicolon_spacing.php 3 0 tests/input/static-closures.php 1 0 tests/input/test-case.php 8 0 -tests/input/traits-uses.php 10 0 +tests/input/traits-uses.php 11 0 tests/input/UnusedVariables.php 1 0 tests/input/useless-semicolon.php 2 0 ---------------------------------------------------------------------- -A TOTAL OF 205 ERRORS AND 0 WARNINGS WERE FOUND IN 24 FILES +A TOTAL OF 207 ERRORS AND 0 WARNINGS WERE FOUND IN 24 FILES ---------------------------------------------------------------------- -PHPCBF CAN FIX 175 OF THESE SNIFF VIOLATIONS AUTOMATICALLY +PHPCBF CAN FIX 177 OF THESE SNIFF VIOLATIONS AUTOMATICALLY ---------------------------------------------------------------------- diff --git a/tests/input/example-class.php b/tests/input/example-class.php index 6d0219cf..b8674423 100644 --- a/tests/input/example-class.php +++ b/tests/input/example-class.php @@ -47,6 +47,7 @@ public function getFoo(): ? int return $this->foo; } + /** * @return iterable */ @@ -83,4 +84,5 @@ public static function getTestCase() : TestCase { return new TestCase(); } + }