Code Duplication    Length = 21-21 lines in 2 locations

Sniffs/PHP/DeprecatedFunctionsSniff.php 1 location

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

Sniffs/PHP/NewFunctionsSniff.php 1 location

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