This repository was archived by the owner on Nov 21, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +102
-0
lines changed Expand file tree Collapse file tree 4 files changed +102
-0
lines changed Original file line number Diff line number Diff line change 2727 <rule ref =" SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming" />
2828 <rule ref =" SlevomatCodingStandard.Classes.SuperfluousExceptionNaming" />
2929 <rule ref =" SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming" />
30+ <rule ref =" SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses" />
31+ <rule ref =" SlevomatCodingStandard.ControlStructures.NewWithParentheses" />
3032 <rule ref =" SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator" />
3133 <rule ref =" SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses" />
3234 <rule ref =" SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly" >
4749 <rule ref =" SlevomatCodingStandard.Operators.RequireCombinedAssignmentOperator" />
4850 <rule ref =" SlevomatCodingStandard.PHP.ShortList" />
4951 <rule ref =" SlevomatCodingStandard.PHP.TypeCast" />
52+ <rule ref =" SlevomatCodingStandard.PHP.UselessParentheses" >
53+ <properties >
54+ <property name =" ignoreComplexTernaryConditions" value =" true" />
55+ </properties >
56+ </rule >
5057 <rule ref =" SlevomatCodingStandard.TypeHints.DeclareStrictTypes" >
5158 <properties >
5259 <property name =" newlinesCountAfterDeclare" value =" 2" />
Original file line number Diff line number Diff line change 1+ ---DESCRIPTION---
2+ Language constructs must be used without parentheses
3+ ---CONTENTS---
4+ <?php
5+
6+ declare(strict_types=1);
7+
8+ require('foo.php');
9+
10+ echo('bar');
11+
12+ foreach ([] as $value) {
13+ break (1);
14+ }
15+
16+ $baz = function () {
17+ yield('baz');
18+ return('qux');
19+ };
20+
21+ die();
22+
23+ ---FIXED---
24+ <?php
25+
26+ declare(strict_types=1);
27+
28+ require 'foo.php';
29+
30+ echo 'bar';
31+
32+ foreach ([] as $value) {
33+ break 1;
34+ }
35+
36+ $baz = function () {
37+ yield 'baz';
38+ return 'qux';
39+ };
40+
41+ die;
42+
43+ ---
Original file line number Diff line number Diff line change 1+ ---DESCRIPTION---
2+ New instances must use parentheses
3+ ---CONTENTS---
4+ <?php
5+
6+ declare(strict_types=1);
7+
8+ new Foo;
9+
10+ ---FIXED---
11+ <?php
12+
13+ declare(strict_types=1);
14+
15+ new Foo();
16+
17+ ---
Original file line number Diff line number Diff line change 1+ ---DESCRIPTION---
2+ Parentheses must not be used unnecessarily
3+ ---CONTENTS---
4+ <?php
5+
6+ declare(strict_types=1);
7+
8+ $foo = ('bar');
9+ $baz = ($qux !== null) ? true : false;
10+ $quux = ($quuz) ? 1 : 0;
11+ $corge = (true || false) ? 0 : 1;
12+
13+ switch ($grault) {
14+ case (true):
15+ case (false):
16+ return $garply / (100 + $waldo);
17+ }
18+
19+ ---FIXED---
20+ <?php
21+
22+ declare(strict_types=1);
23+
24+ $foo = 'bar';
25+ $baz = $qux !== null ? true : false;
26+ $quux = $quuz ? 1 : 0;
27+ $corge = (true || false) ? 0 : 1;
28+
29+ switch ($grault) {
30+ case true:
31+ case false:
32+ return $garply / (100 + $waldo);
33+ }
34+
35+ ---
You can’t perform that action at this time.
0 commit comments