Code Duplication    Length = 20-21 lines in 2 locations

PHPCompatibility/Sniffs/PHP/NewInterfacesSniff.php 1 location

@@ 238-257 (lines=20) @@
235
     *
236
     * @return void
237
     */
238
    private function processFunctionToken(\PHP_CodeSniffer_File $phpcsFile, $stackPtr)
239
    {
240
        $typeHints = $this->getTypeHintsFromFunctionDeclaration($phpcsFile, $stackPtr);
241
        if (empty($typeHints) || is_array($typeHints) === false) {
242
            return;
243
        }
244
245
        foreach ($typeHints as $hint) {
246
247
            $typeHintLc = strtolower($hint);
248
249
            if (isset($this->newInterfaces[$typeHintLc]) === true) {
250
                $itemInfo = array(
251
                    'name'   => $hint,
252
                    'nameLc' => $typeHintLc,
253
                );
254
                $this->handleFeature($phpcsFile, $stackPtr, $itemInfo);
255
            }
256
        }
257
    }
258
259
260
    /**

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
    /**