Code Duplication    Length = 20-20 lines in 2 locations

Sniffs/PHP/NewHashAlgorithmsSniff.php 1 location

@@ 96-115 (lines=20) @@
93
     *
94
     * @return void
95
     */
96
    public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
97
    {
98
        $algo = $this->getHashAlgorithmParameter($phpcsFile, $stackPtr);
99
        if (empty($algo) || is_string($algo) === false) {
100
            return;
101
        }
102
103
        // Bow out if not one of the algorithms we're targetting.
104
        if (isset($this->newAlgorithms[$algo]) === false) {
105
            return;
106
        }
107
108
        // Check if the algorithm used is new.
109
        $errorInfo = $this->getErrorInfo($algo);
110
111
        if ($errorInfo['not_in_version'] !== '') {
112
            $this->addError($phpcsFile, $stackPtr, $algo, $errorInfo);
113
        }
114
115
    }//end process()
116
117
118
    /**

Sniffs/PHP/RemovedHashAlgorithmsSniff.php 1 location

@@ 66-85 (lines=20) @@
63
     *
64
     * @return void
65
     */
66
    public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
67
    {
68
        $algo = $this->getHashAlgorithmParameter($phpcsFile, $stackPtr);
69
        if (empty($algo) || is_string($algo) === false) {
70
            return;
71
        }
72
73
        // Bow out if not one of the algorithms we're targetting.
74
        if (isset($this->removedAlgorithms[$algo]) === false) {
75
            return;
76
        }
77
78
        // Check if the algorithm used is deprecated or removed.
79
        $errorInfo = $this->getErrorInfo($algo);
80
81
        if ($errorInfo['deprecated'] !== '' || $errorInfo['removed'] !== '') {
82
            $this->addError($phpcsFile, $stackPtr, $algo, $errorInfo);
83
        }
84
85
    }//end process()
86
87
88
    /**