Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sniff to forbid multiple lines between functions #95

Merged
merged 1 commit into from Nov 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/Doctrine/ruleset.xml
Expand Up @@ -444,6 +444,14 @@
<rule ref="Squiz.WhiteSpace.CastSpacing"/>
<!-- Forbid blank line after function opening brace -->
<rule ref="Squiz.WhiteSpace.FunctionOpeningBraceSpace"/>
<!-- Require 1 line before and after function, except at the top and bottom -->
<rule ref="Squiz.WhiteSpace.FunctionSpacing">
<properties>
<property name="spacing" value="1" />
<property name="spacingBeforeFirst" value="0"/>
<property name="spacingAfterLast" value="0"/>
</properties>
</rule>
<!-- Require space after language constructs -->
<rule ref="Squiz.WhiteSpace.LanguageConstructSpacing"/>
<!-- Require space around logical operators -->
Expand Down
8 changes: 4 additions & 4 deletions tests/expected_report.txt
Expand Up @@ -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 32 0
tests/input/forbidden-comments.php 4 0
tests/input/forbidden-functions.php 6 0
tests/input/LowCaseTypes.php 2 0
Expand All @@ -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 210 ERRORS AND 0 WARNINGS WERE FOUND IN 24 FILES
----------------------------------------------------------------------
PHPCBF CAN FIX 175 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
PHPCBF CAN FIX 180 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


2 changes: 2 additions & 0 deletions tests/input/example-class.php
Expand Up @@ -47,6 +47,7 @@ public function getFoo(): ? int
return $this->foo;
}


/**
* @return iterable
*/
Expand Down Expand Up @@ -83,4 +84,5 @@ public static function getTestCase() : TestCase
{
return new TestCase();
}

}