Code Duplication    Length = 20-21 lines in 2 locations

Sniffs/PHP/NewInterfacesSniff.php 1 location

@@ 230-249 (lines=20) @@
227
     *
228
     * @return void
229
     */
230
    private function processFunctionToken(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
231
    {
232
        $typeHints = $this->getTypeHintsFromFunctionDeclaration($phpcsFile, $stackPtr);
233
        if (empty($typeHints) || is_array($typeHints) === false) {
234
            return;
235
        }
236
237
        foreach ($typeHints as $hint) {
238
239
            $typeHintLc = strtolower($hint);
240
241
            if (isset($this->newInterfaces[$typeHintLc]) === true) {
242
                $itemInfo = array(
243
                    'name'   => $hint,
244
                    'nameLc' => $typeHintLc,
245
                );
246
                $this->handleFeature($phpcsFile, $stackPtr, $itemInfo);
247
            }
248
        }
249
    }
250
251
252
    /**

Sniffs/PHP/NewClassesSniff.php 1 location

@@ 452-472 (lines=21) @@
449
     *
450
     * @return void
451
     */
452
    private function processFunctionToken(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
453
    {
454
        // Retrieve typehints stripped of global NS indicator and/or nullable indicator.
455
        $typeHints = $this->getTypeHintsFromFunctionDeclaration($phpcsFile, $stackPtr);
456
        if (empty($typeHints) || is_array($typeHints) === false) {
457
            return;
458
        }
459
460
        foreach ($typeHints as $hint) {
461
462
            $typeHintLc = strtolower($hint);
463
464
            if (isset($this->newClasses[$typeHintLc]) === true) {
465
                $itemInfo = array(
466
                    'name'   => $hint,
467
                    'nameLc' => $typeHintLc,
468
                );
469
                $this->handleFeature($phpcsFile, $stackPtr, $itemInfo);
470
            }
471
        }
472
    }
473
474
475
    /**