@@ -23,18 +23,18 @@ public function processTokenOutsideScope(File $phpcsFile, $stackPtr)
2323 // Does this function claim to be magical?
2424 if (preg_match ('|^__[^_]| ' , $ functionName ) !== 0 ) {
2525 $ error = 'Function name "%s" is invalid; only PHP magic methods should be prefixed with a double underscore ' ;
26- $ phpcsFile ->addError ($ error , $ stackPtr , 'DoubleUnderscore ' , $ errorData );
26+ $ phpcsFile ->addWarning ($ error , $ stackPtr , 'DoubleUnderscore ' , $ errorData );
2727
2828 $ functionName = ltrim ($ functionName , '_ ' );
2929 }
3030
31- if (preg_match (',^(balise|boucle|critere|iterateur)_([a-z0-9_]+),i ' , $ functionName , $ matches )) {
31+ if (preg_match (',^(balise|boucle|critere|iterateur)_([a-z0-9_]+),i ' , $ functionName , $ matches )) {
3232 $ fullName = $ functionName ;
3333
3434 $ functionPrefix = strtolower ($ matches [1 ]);
3535 if ($ functionPrefix !== $ matches [1 ]) {
3636 $ error = 'Special function name "%s" is invalid; Prefix %s must be in lowercase" ' ;
37- $ phpcsFile ->addError ($ error , $ stackPtr , 'PrefixLowerCase ' , [$ fullName , $ functionPrefix ]);
37+ $ phpcsFile ->addWarning ($ error , $ stackPtr , 'PrefixLowerCase ' , [$ fullName , $ functionPrefix ]);
3838 }
3939
4040 $ functionName = $ matches [2 ];
@@ -43,14 +43,14 @@ public function processTokenOutsideScope(File $phpcsFile, $stackPtr)
4343 $ functionSuffix = strtolower ($ matches2 [1 ]);
4444 if ($ functionSuffix !== $ matches2 [1 ]) {
4545 $ error = 'Special function name "%s" is invalid; Suffix %s must be in lowercase" ' ;
46- $ phpcsFile ->addError ($ error , $ stackPtr , 'SuffixLowerCase ' , [$ fullName , $ functionSuffix ]);
46+ $ phpcsFile ->addWarning ($ error , $ stackPtr , 'SuffixLowerCase ' , [$ fullName , $ functionSuffix ]);
4747 }
4848 }
4949
5050 if ($ functionSuffix ) {
5151 if ($ functionPrefix !== 'balise ' && $ functionSuffix !== 'dist ' ) {
5252 $ error = 'Special function name "%s" is invalid; Suffix %s is not allowed with prefix %s" ' ;
53- $ phpcsFile ->addError ($ error , $ stackPtr , 'SuffixNotAllowed ' , [$ fullName , $ functionSuffix , $ functionPrefix ]);
53+ $ phpcsFile ->addWarning ($ error , $ stackPtr , 'SuffixNotAllowed ' , [$ fullName , $ functionSuffix , $ functionPrefix ]);
5454 }
5555 $ functionName = preg_replace (",_ $ matches2 [1 ]$, " , '' , $ functionName );
5656 }
@@ -61,10 +61,10 @@ public function processTokenOutsideScope(File $phpcsFile, $stackPtr)
6161
6262 if ($ functionName !== strtoupper ($ functionName )) {
6363 $ error = 'Special function name "%s" is invalid; Body %s must be in uppercase" ' ;
64- $ phpcsFile ->addError ($ error , $ stackPtr , 'ScreamingSnakeCase ' , [$ fullName , $ functionName ]);
64+ $ phpcsFile ->addWarning ($ error , $ stackPtr , 'ScreamingSnakeCase ' , [$ fullName , $ functionName ]);
6565 }
6666 } elseif (!SnakeCase::isSnakeCase ($ functionName )) {
67- $ phpcsFile ->addError (
67+ $ phpcsFile ->addWarning (
6868 'Function name "%s" is not in snake case format (Suggested name: %s) ' ,
6969 $ stackPtr ,
7070 'NotSnakeCase ' ,
0 commit comments