From 86d32bab57d940990f026d13667517b1028867b5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 28 Nov 2013 00:57:14 +0100 Subject: [PATCH] Completely remove DiscouragePCRESniff --- .../WCF/Sniffs/PHP/DiscouragePCRESniff.php | 52 ------------------- CodeSniff/WCF/ruleset.xml | 1 - 2 files changed, 53 deletions(-) delete mode 100644 CodeSniff/WCF/Sniffs/PHP/DiscouragePCRESniff.php diff --git a/CodeSniff/WCF/Sniffs/PHP/DiscouragePCRESniff.php b/CodeSniff/WCF/Sniffs/PHP/DiscouragePCRESniff.php deleted file mode 100644 index e221f6ba59..0000000000 --- a/CodeSniff/WCF/Sniffs/PHP/DiscouragePCRESniff.php +++ /dev/null @@ -1,52 +0,0 @@ - - * @package com.woltlab.wcf - * @category Community Framework - */ -class WCF_Sniffs_PHP_DiscouragePCRESniff/* extends Generic_Sniffs_PHP_ForbiddenFunctionsSniff*/ { - /** - * A list of forbidden functions with their alternatives. - * - * The value is NULL if no alternative exists. IE, the - * function should just not be used. - * - * @var array(string => string|null) - */ - protected $forbiddenFunctions = array( - 'preg_match_all' => null, - 'preg_match' => null, - 'preg_replace' => null, - 'preg_replace_callback' => null, - 'preg_split' => null - ); - - /** - * Constructor. - */ - public function __construct() { - return; - } - - /** - * Generates the error or warning for this sniff. - * - * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the forbidden function - * in the token array. - * @param string $function The name of the forbidden function. - * @param string $pattern The pattern used for the match. - * - * @return void - */ - protected function addError($phpcsFile, $stackPtr, $function, $pattern = null) { - $data = array($function); - $error = 'Use of raw PCRE %s() is discouraged. Please use \wcf\system\Regex which provides OO-access to regex'; - $type = 'Discourage'; - - $phpcsFile->addWarning($error, $stackPtr, $type, $data); - } -} diff --git a/CodeSniff/WCF/ruleset.xml b/CodeSniff/WCF/ruleset.xml index 9df07620ed..39307f3c03 100644 --- a/CodeSniff/WCF/ruleset.xml +++ b/CodeSniff/WCF/ruleset.xml @@ -36,7 +36,6 @@ - -- 2.20.1