Code Duplication    Length = 20-21 lines in 2 locations

Sniffs/PHP/NewInterfacesSniff.php 1 location

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

Sniffs/PHP/NewClassesSniff.php 1 location

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