Code Duplication    Length = 21-21 lines in 2 locations

Sniffs/PHP/NewFunctionsSniff.php 1 location

@@ 1154-1174 (lines=21) @@
1151
        $function = strtolower($tokens[$stackPtr]['content']);
1152
        $pattern  = null;
1153
1154
        if ($this->patternMatch === true) {
1155
            $count   = 0;
1156
            $pattern = preg_replace(
1157
                    $this->forbiddenFunctionNames,
1158
                    $this->forbiddenFunctionsNames,
1159
                    $function,
1160
                    1,
1161
                    $count
1162
            );
1163
1164
            if ($count === 0) {
1165
                return;
1166
            }
1167
1168
            // Remove the pattern delimiters and modifier.
1169
            $pattern = substr($pattern, 1, -2);
1170
        } else {
1171
            if (in_array($function, $this->forbiddenFunctionNames) === false) {
1172
                return;
1173
            }
1174
        }
1175
1176
        $this->addError($phpcsFile, $stackPtr, $function, $pattern);
1177

Sniffs/PHP/DeprecatedFunctionsSniff.php 1 location

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