Mercurial > hg > isophonics-drupal-site
comparison vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/PregSecuritySniff.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
1 <?php | 1 <?php |
2 /** | 2 /** |
3 * Drupal_Sniffs_Semantics_PregSecuritySniff. | 3 * \Drupal\Sniffs\Semantics\PregSecuritySniff. |
4 * | 4 * |
5 * @category PHP | 5 * @category PHP |
6 * @package PHP_CodeSniffer | 6 * @package PHP_CodeSniffer |
7 * @link http://pear.php.net/package/PHP_CodeSniffer | 7 * @link http://pear.php.net/package/PHP_CodeSniffer |
8 */ | 8 */ |
9 | |
10 namespace Drupal\Sniffs\Semantics; | |
11 | |
12 use Drupal\Sniffs\Semantics\FunctionCall; | |
13 use PHP_CodeSniffer\Files\File; | |
9 | 14 |
10 /** | 15 /** |
11 * Check the usage of the preg functions to ensure the insecure /e flag isn't | 16 * Check the usage of the preg functions to ensure the insecure /e flag isn't |
12 * used: https://www.drupal.org/node/750148 | 17 * used: https://www.drupal.org/node/750148 |
13 * | 18 * |
14 * @category PHP | 19 * @category PHP |
15 * @package PHP_CodeSniffer | 20 * @package PHP_CodeSniffer |
16 * @link http://pear.php.net/package/PHP_CodeSniffer | 21 * @link http://pear.php.net/package/PHP_CodeSniffer |
17 */ | 22 */ |
18 class Drupal_Sniffs_Semantics_PregSecuritySniff extends Drupal_Sniffs_Semantics_FunctionCall | 23 class PregSecuritySniff extends FunctionCall |
19 { | 24 { |
20 | 25 |
21 | 26 |
22 /** | 27 /** |
23 * Returns an array of function names this test wants to listen for. | 28 * Returns an array of function names this test wants to listen for. |
40 | 45 |
41 | 46 |
42 /** | 47 /** |
43 * Processes this function call. | 48 * Processes this function call. |
44 * | 49 * |
45 * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. | 50 * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. |
46 * @param int $stackPtr The position of the function call in | 51 * @param int $stackPtr The position of the function call in |
47 * the stack. | 52 * the stack. |
48 * @param int $openBracket The position of the opening | 53 * @param int $openBracket The position of the opening |
49 * parenthesis in the stack. | 54 * parenthesis in the stack. |
50 * @param int $closeBracket The position of the closing | 55 * @param int $closeBracket The position of the closing |
51 * parenthesis in the stack. | 56 * parenthesis in the stack. |
52 * | 57 * |
53 * @return void | 58 * @return void |
54 */ | 59 */ |
55 public function processFunctionCall( | 60 public function processFunctionCall( |
56 PHP_CodeSniffer_File $phpcsFile, | 61 File $phpcsFile, |
57 $stackPtr, | 62 $stackPtr, |
58 $openBracket, | 63 $openBracket, |
59 $closeBracket | 64 $closeBracket |
60 ) { | 65 ) { |
61 $tokens = $phpcsFile->getTokens(); | 66 $tokens = $phpcsFile->getTokens(); |