Skip to content

Commit 0471ea4

Browse files
committed
BadFunctions/EasyRFI: use the build-in PHPCS functionality [2]
The PHPCS native `PHP_CodeSniffer\Util\Tokens` class contains a number of useful token groups. For this particular sniff, the `Tokens::$includeTokens` applies and contains all the relevant tokens. It is generally a good idea to use the build-in token groups, as when something would change in how PHP and/or PHPCS tokenizes certain constructs, those groups will be updated too.
1 parent 437c7f6 commit 0471ea4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Security/Sniffs/BadFunctions/EasyRFISniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function register() {
2525
$this->search += \PHP_CodeSniffer\Util\Tokens::$bracketTokens;
2626
$this->search += \PHPCS_SecurityAudit\Security\Sniffs\Utils::$staticTokens;
2727

28-
return array(T_INCLUDE, T_INCLUDE_ONCE, T_REQUIRE, T_REQUIRE_ONCE);
28+
return \PHP_CodeSniffer\Util\Tokens::$includeTokens;
2929
}
3030

3131
/**

0 commit comments

Comments
 (0)