We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6bed665 commit 31329f4Copy full SHA for 31329f4
src/Standards/Generic/Sniffs/PHP/ForbiddenFunctionsSniff.php
@@ -74,15 +74,15 @@ public function register()
74
75
// If we are not pattern matching, we need to work out what
76
// tokens to listen for.
77
- $string = '<?php ';
+ $tokens = [];
78
foreach ($this->forbiddenFunctionNames as $name) {
79
- $string .= $name.'();';
+ $token = token_get_all(sprintf('<?php %s();', $name));
80
+ array_shift($token);
81
+ $tokens = array_merge($tokens, $token);
82
}
83
84
$register = [];
85
- $tokens = token_get_all($string);
- array_shift($tokens);
86
foreach ($tokens as $token) {
87
if (is_array($token) === true) {
88
$register[] = $token[0];
0 commit comments