Skip to content

Commit fc6f36c

Browse files
committed
Merge branch 'hotfix/lowercase-keywords-3.0' of https://github.com/webimpress/PHP_CodeSniffer
2 parents 03e11ba + 527f2bb commit fc6f36c

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

src/Standards/Generic/Sniffs/PHP/LowerCaseKeywordSniff.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function register()
3535
T_CATCH,
3636
T_CLASS,
3737
T_CLONE,
38+
T_CLOSURE,
3839
T_CONST,
3940
T_CONTINUE,
4041
T_DECLARE,
@@ -74,13 +75,15 @@ public function register()
7475
T_LOGICAL_XOR,
7576
T_NAMESPACE,
7677
T_NEW,
78+
T_PARENT,
7779
T_PRINT,
7880
T_PRIVATE,
7981
T_PROTECTED,
8082
T_PUBLIC,
8183
T_REQUIRE,
8284
T_REQUIRE_ONCE,
8385
T_RETURN,
86+
T_SELF,
8487
T_STATIC,
8588
T_SWITCH,
8689
T_THROW,
@@ -90,6 +93,8 @@ public function register()
9093
T_USE,
9194
T_VAR,
9295
T_WHILE,
96+
T_YIELD,
97+
T_YIELD_FROM,
9398
);
9499

95100
}//end register()

src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,16 @@ GOTO a;
1616
function (Array $a) {}
1717
const PRIVATE;
1818
HttpStatus::CONTINUE;
19+
Function ($f) {
20+
Yield $f;
21+
Yield From fun();
22+
}
23+
class X extends Y {
24+
public function m() {
25+
Parent::m();
26+
}
27+
public function n() {
28+
Self::n();
29+
}
30+
}
1931
function

src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc.fixed

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,16 @@ goto a;
1616
function (array $a) {}
1717
const PRIVATE;
1818
HttpStatus::CONTINUE;
19+
function ($f) {
20+
yield $f;
21+
yield from fun();
22+
}
23+
class X extends Y {
24+
public function m() {
25+
parent::m();
26+
}
27+
public function n() {
28+
self::n();
29+
}
30+
}
1931
function

src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ public function getErrorList()
3333
14 => 7,
3434
15 => 1,
3535
16 => 1,
36+
19 => 1,
37+
20 => 1,
38+
21 => 1,
39+
25 => 1,
40+
28 => 1,
3641
);
3742

3843
}//end getErrorList()

0 commit comments

Comments
 (0)