Skip to content
This repository was archived by the owner on Jan 21, 2020. It is now read-only.

Commit c2d224c

Browse files
committed
Added ScopeIndent sniff and adjust tests to pass with all sniffs
1 parent 391acf0 commit c2d224c

File tree

5 files changed

+22
-15
lines changed

5 files changed

+22
-15
lines changed

src/ZendCodingStandard/ruleset.xml

+6
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@
8282
<!-- Only one blank line allowed -->
8383
<rule ref="WebimpressCodingStandard.WhiteSpace.BlankLine"/>
8484

85+
<rule ref="WebimpressCodingStandard.WhiteSpace.ScopeIndent">
86+
<properties>
87+
<property name="alignObjectOperators" value="false"></property>
88+
</properties>
89+
</rule>
90+
8591
<!-- Detects for-loops that can be simplified to a while-loop -->
8692
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
8793
<!-- Detects unconditional if- and elseif-statements -->

test/expected-report.txt

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ PHP CODE SNIFFER REPORT SUMMARY
44
FILE ERRORS WARNINGS
55
----------------------------------------------------------------------
66
test/fixable/anonymous-classes.php 11 0
7-
test/fixable/array-indentation.php 39 1
7+
test/fixable/array-indentation.php 47 1
88
test/fixable/class-name-resolution.php 15 0
99
test/fixable/class-properties.php 6 0
1010
test/fixable/classes-traits-interfaces.php 16 1
1111
test/fixable/closures.php 19 0
1212
test/fixable/commenting.php 26 0
13-
test/fixable/concatenation-spacing.php 17 0
13+
test/fixable/concatenation-spacing.php 21 0
1414
test/fixable/control-structures.php 6 0
1515
test/fixable/example-class.php 29 0
16-
test/fixable/extends-and-implements-multiline.php 10 0
17-
test/fixable/extends-and-implements.php 13 0
16+
test/fixable/extends-and-implements-multiline.php 13 0
17+
test/fixable/extends-and-implements.php 5 0
1818
test/fixable/forbidden-comments.php 6 0
1919
test/fixable/forbidden-functions.php 6 0
2020
test/fixable/heredoc-nowdoc.php 6 0
@@ -25,21 +25,21 @@ test/fixable/namespaces-spacing.php 7 0
2525
test/fixable/naming.php 11 0
2626
test/fixable/new-with-parentheses.php 19 0
2727
test/fixable/not-spacing.php 20 1
28-
test/fixable/operators.php 12 0
28+
test/fixable/operators.php 17 0
2929
test/fixable/return-type-on-methods.php 17 0
30-
test/fixable/semicolon-spacing.php 3 0
30+
test/fixable/semicolon-spacing.php 5 0
3131
test/fixable/spacing.php 18 1
3232
test/fixable/statement-alignment.php 19 0
3333
test/fixable/test-case.php 4 0
3434
test/fixable/traits-uses.php 9 0
3535
test/fixable/UnusedVariables.php 1 0
36-
test/fixable/useless-semicolon.php 8 0
36+
test/fixable/useless-semicolon.php 9 0
3737
test/fixable/variable-names.php 5 2
3838
test/fixable/visibility-declaration.php 1 0
3939
----------------------------------------------------------------------
40-
A TOTAL OF 407 ERRORS AND 6 WARNINGS WERE FOUND IN 33 FILES
40+
A TOTAL OF 427 ERRORS AND 6 WARNINGS WERE FOUND IN 33 FILES
4141
----------------------------------------------------------------------
42-
PHPCBF CAN FIX 345 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
42+
PHPCBF CAN FIX 365 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
4343
----------------------------------------------------------------------
4444

4545

test/fixed/array-indentation.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
App\Http\Auth\LogoutHandler::class => App\Http\Auth\LogoutHandlerFactory::class,
6060

6161
App\Infrastructure\View\TemplateDefaultsMiddleware::class
62-
=> App\Infrastructure\View\TemplateDefaultsMiddlewareFactory::class,
62+
=> App\Infrastructure\View\TemplateDefaultsMiddlewareFactory::class,
6363
App\Http\HomePageHandler::class => App\Http\HomePageHandlerFactory::class,
6464
App\Http\StaticPageHandler::class => App\Http\StaticPageHandlerFactory::class,
6565
],

test/fixed/concatenation-spacing.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
$string .= $foo;
1818

1919
$string = '1'
20-
. '2'
21-
. '3';
20+
. '2'
21+
. '3';
2222

2323
$string = '1'
24-
. '2'
25-
. '3';
24+
. '2'
25+
. '3';

test/fixed/operators.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
echo Something::BAR;
3636

3737
if ($a
38-
&& $b) {
38+
&& $b
39+
) {
3940
echo 1;
4041
}
4142

0 commit comments

Comments
 (0)