Code Duplication    Length = 20-21 lines in 2 locations

PHPCompatibility/Sniffs/PHP/NewClassesSniff.php 1 location

@@ 659-679 (lines=21) @@
656
     *
657
     * @return void
658
     */
659
    private function processFunctionToken(\PHP_CodeSniffer_File $phpcsFile, $stackPtr)
660
    {
661
        // Retrieve typehints stripped of global NS indicator and/or nullable indicator.
662
        $typeHints = $this->getTypeHintsFromFunctionDeclaration($phpcsFile, $stackPtr);
663
        if (empty($typeHints) || is_array($typeHints) === false) {
664
            return;
665
        }
666
667
        foreach ($typeHints as $hint) {
668
669
            $typeHintLc = strtolower($hint);
670
671
            if (isset($this->newClasses[$typeHintLc]) === true) {
672
                $itemInfo = array(
673
                    'name'   => $hint,
674
                    'nameLc' => $typeHintLc,
675
                );
676
                $this->handleFeature($phpcsFile, $stackPtr, $itemInfo);
677
            }
678
        }
679
    }
680
681
682
    /**

PHPCompatibility/Sniffs/PHP/NewInterfacesSniff.php 1 location

@@ 252-271 (lines=20) @@
249
     *
250
     * @return void
251
     */
252
    private function processFunctionToken(\PHP_CodeSniffer_File $phpcsFile, $stackPtr)
253
    {
254
        $typeHints = $this->getTypeHintsFromFunctionDeclaration($phpcsFile, $stackPtr);
255
        if (empty($typeHints) || is_array($typeHints) === false) {
256
            return;
257
        }
258
259
        foreach ($typeHints as $hint) {
260
261
            $typeHintLc = strtolower($hint);
262
263
            if (isset($this->newInterfaces[$typeHintLc]) === true) {
264
                $itemInfo = array(
265
                    'name'   => $hint,
266
                    'nameLc' => $typeHintLc,
267
                );
268
                $this->handleFeature($phpcsFile, $stackPtr, $itemInfo);
269
            }
270
        }
271
    }
272
273
274
    /**