| @@ 692-712 (lines=21) @@ | ||
| 689 | $function = strtolower($tokens[$stackPtr]['content']); |
|
| 690 | $pattern = null; |
|
| 691 | ||
| 692 | if ($this->patternMatch === true) { |
|
| 693 | $count = 0; |
|
| 694 | $pattern = preg_replace( |
|
| 695 | $this->forbiddenFunctionNames, |
|
| 696 | $this->forbiddenFunctionNames, |
|
| 697 | $function, |
|
| 698 | 1, |
|
| 699 | $count |
|
| 700 | ); |
|
| 701 | ||
| 702 | if ($count === 0) { |
|
| 703 | return; |
|
| 704 | } |
|
| 705 | ||
| 706 | // Remove the pattern delimiters and modifier. |
|
| 707 | $pattern = substr($pattern, 1, -2); |
|
| 708 | } else { |
|
| 709 | if (in_array($function, $this->forbiddenFunctionNames) === false) { |
|
| 710 | return; |
|
| 711 | } |
|
| 712 | } |
|
| 713 | ||
| 714 | $this->addError($phpcsFile, $stackPtr, $function, $pattern); |
|
| 715 | ||
| @@ 1282-1302 (lines=21) @@ | ||
| 1279 | $function = strtolower($tokens[$stackPtr]['content']); |
|
| 1280 | $pattern = null; |
|
| 1281 | ||
| 1282 | if ($this->patternMatch === true) { |
|
| 1283 | $count = 0; |
|
| 1284 | $pattern = preg_replace( |
|
| 1285 | $this->forbiddenFunctionNames, |
|
| 1286 | $this->forbiddenFunctionNames, |
|
| 1287 | $function, |
|
| 1288 | 1, |
|
| 1289 | $count |
|
| 1290 | ); |
|
| 1291 | ||
| 1292 | if ($count === 0) { |
|
| 1293 | return; |
|
| 1294 | } |
|
| 1295 | ||
| 1296 | // Remove the pattern delimiters and modifier. |
|
| 1297 | $pattern = substr($pattern, 1, -2); |
|
| 1298 | } else { |
|
| 1299 | if (in_array($function, $this->forbiddenFunctionNames) === false) { |
|
| 1300 | return; |
|
| 1301 | } |
|
| 1302 | } |
|
| 1303 | ||
| 1304 | $this->addError($phpcsFile, $stackPtr, $tokens[$stackPtr]['content'], $pattern); |
|
| 1305 | ||