private function _testPhpMbstringKeywords($file) { $phpKeywordValidationRules = [new PhpKeywordValidationRule(T_STRING, ['ereg', 'eregi', 'eregi_replace', 'ereg_replace', 'mail', 'split', 'stripos', 'stristr', 'strlen', 'strpos', 'strrchr', 'strripos', 'strrpos', 'strstr', 'strtolower', 'strtoupper', 'substr', 'substr_count'], 'Not multibyte string function found. Are you sure?', Constants::RETURN_CODE_WARNING)]; $outputInterface = new OutputInterfaceMock(); $validator = new PhpKeywordsValidator([$file], $this->tmpdir, $outputInterface); $validator->setValidationRules($phpKeywordValidationRules); return $validator->validate(); }
private function _testPhpForbiddenKeywords($file) { $phpKeywordValidationRules = [new PhpKeywordValidationRule(T_STRING, ['var_dump'], 'var_dump() function call found', Constants::RETURN_CODE_ERROR), new PhpKeywordValidationRule(T_EMPTY, ['empty'], 'empty() operator found', Constants::RETURN_CODE_WARNING)]; $outputInterface = new OutputInterfaceMock(); $validator = new PhpKeywordsValidator([$file], $this->tmpdir, $outputInterface); $validator->setValidationRules($phpKeywordValidationRules); return $validator->validate(); }