Skip to content

Commit

Permalink
Merge pull request #120 from doctrine/newline-return
Browse files Browse the repository at this point in the history
Require newline before return
  • Loading branch information
Ocramius committed Mar 15, 2019
2 parents 2baaf29 + fe9849c commit d33f69e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
8 changes: 8 additions & 0 deletions lib/Doctrine/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,14 @@
<rule ref="SlevomatCodingStandard.Commenting.RequireOneLinePropertyDocComment"/>
<!-- Forbid assignments in conditions -->
<rule ref="SlevomatCodingStandard.ControlStructures.AssignmentInCondition"/>
<!-- Require consistent spacing for control structures -->
<rule ref="SlevomatCodingStandard.ControlStructures.ControlStructureSpacing">
<properties>
<property name="tokensToCheck" type="array">
<element value="T_RETURN" />
</property>
</properties>
</rule>
<!-- Forbid fancy yoda conditions -->
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison"/>
<!-- Require usage of early exit -->
Expand Down
6 changes: 3 additions & 3 deletions tests/expected_report.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tests/input/constants-var.php 3 0
tests/input/doc-comment-spacing.php 10 0
tests/input/duplicate-assignment-variable.php 1 0
tests/input/EarlyReturn.php 6 0
tests/input/example-class.php 32 0
tests/input/example-class.php 33 0
tests/input/forbidden-comments.php 8 0
tests/input/forbidden-functions.php 6 0
tests/input/LowCaseTypes.php 2 0
Expand All @@ -34,9 +34,9 @@ tests/input/UnusedVariables.php 1 0
tests/input/useless-semicolon.php 2 0
tests/input/UselessConditions.php 20 0
----------------------------------------------------------------------
A TOTAL OF 257 ERRORS AND 0 WARNINGS WERE FOUND IN 30 FILES
A TOTAL OF 258 ERRORS AND 0 WARNINGS WERE FOUND IN 30 FILES
----------------------------------------------------------------------
PHPCBF CAN FIX 209 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
PHPCBF CAN FIX 210 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


1 change: 1 addition & 0 deletions tests/fixed/example-class.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public function getFoo() : ?int
public function getIterator() : array
{
assert($this->bar !== null);

return new ArrayIterator($this->bar);
}

Expand Down

0 comments on commit d33f69e

Please sign in to comment.