Skip to content

Generic/LowerCaseKeyword: remove some redundant code #600

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

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/Standards/Generic/Sniffs/PHP/LowerCaseKeywordSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,10 @@ public function register()
$targets += [
T_ANON_CLASS => T_ANON_CLASS,
T_CLOSURE => T_CLOSURE,
T_EMPTY => T_EMPTY,
T_ENUM_CASE => T_ENUM_CASE,
T_EVAL => T_EVAL,
T_ISSET => T_ISSET,
T_MATCH_DEFAULT => T_MATCH_DEFAULT,
T_PARENT => T_PARENT,
T_SELF => T_SELF,
T_UNSET => T_UNSET,
];

return $targets;
Expand Down
5 changes: 5 additions & 0 deletions src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,10 @@ new Class {};
new clasS extends stdClass {};
new class {};

if (isset($a) && !empty($a)) { unset($a); }
if (ISSET($a) && !Empty($a)) { UnSeT($a); }
eval('foo');
eVaL('foo');

__HALT_COMPILER(); // An exception due to phar support.
function
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,10 @@ new class {};
new class extends stdClass {};
new class {};

if (isset($a) && !empty($a)) { unset($a); }
if (isset($a) && !empty($a)) { unset($a); }
eval('foo');
eval('foo');

__HALT_COMPILER(); // An exception due to phar support.
function
2 changes: 2 additions & 0 deletions src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public function getErrorList()
44 => 1,
47 => 1,
48 => 1,
52 => 3,
54 => 1,
];

}//end getErrorList()
Expand Down