Code Duplication    Length = 21-21 lines in 2 locations

Sniffs/PHP/DeprecatedFunctionsSniff.php 1 location

@@ 668-688 (lines=21) @@
665
        $function = strtolower($tokens[$stackPtr]['content']);
666
        $pattern  = null;
667
668
        if ($this->patternMatch === true) {
669
            $count   = 0;
670
            $pattern = preg_replace(
671
                    $this->forbiddenFunctionNames,
672
                    $this->forbiddenFunctionNames,
673
                    $function,
674
                    1,
675
                    $count
676
            );
677
678
            if ($count === 0) {
679
                return;
680
            }
681
682
            // Remove the pattern delimiters and modifier.
683
            $pattern = substr($pattern, 1, -2);
684
        } else {
685
            if (in_array($function, $this->forbiddenFunctionNames) === false) {
686
                return;
687
            }
688
        }
689
690
        $this->addError($phpcsFile, $stackPtr, $function, $pattern);
691

Sniffs/PHP/NewFunctionsSniff.php 1 location

@@ 1235-1255 (lines=21) @@
1232
        $function = strtolower($tokens[$stackPtr]['content']);
1233
        $pattern  = null;
1234
1235
        if ($this->patternMatch === true) {
1236
            $count   = 0;
1237
            $pattern = preg_replace(
1238
                    $this->forbiddenFunctionNames,
1239
                    $this->forbiddenFunctionNames,
1240
                    $function,
1241
                    1,
1242
                    $count
1243
            );
1244
1245
            if ($count === 0) {
1246
                return;
1247
            }
1248
1249
            // Remove the pattern delimiters and modifier.
1250
            $pattern = substr($pattern, 1, -2);
1251
        } else {
1252
            if (in_array($function, $this->forbiddenFunctionNames) === false) {
1253
                return;
1254
            }
1255
        }
1256
1257
        $this->addError($phpcsFile, $stackPtr, $function, $pattern);
1258