Code Duplication    Length = 3-3 lines in 3 locations

PHPCompatibility/Sniff.php 2 locations

@@ 1218-1220 (lines=3) @@
1215
    {
1216
        $tokens = $phpcsFile->getTokens();
1217
1218
        if ($tokens[$stackPtr]['code'] !== T_FUNCTION && $tokens[$stackPtr]['code'] !== T_CLOSURE) {
1219
            return array();
1220
        }
1221
1222
        $parameters = PHPCSHelper::getMethodParameters($phpcsFile, $stackPtr);
1223
        if (empty($parameters) || is_array($parameters) === false) {
@@ 989-991 (lines=3) @@
986
            return $tokens[$stackPtr]['code'];
987
        }
988
989
        if ($tokens[$stackPtr]['code'] !== T_FUNCTION && $tokens[$stackPtr]['code'] !== T_CLOSURE) {
990
            return false;
991
        }
992
993
        if (isset($tokens[$stackPtr]['parenthesis_closer'], $tokens[$stackPtr]['scope_opener']) === false
994
            || ($tokens[$stackPtr]['parenthesis_closer'] + 1) === $tokens[$stackPtr]['scope_opener']

PHPCompatibility/PHPCSHelper.php 1 location

@@ 373-375 (lines=3) @@
370
            return false;
371
        }
372
373
        if ($tokens[$stackPtr]['code'] !== T_FUNCTION
374
            && $tokens[$stackPtr]['code'] !== T_CLOSURE
375
        ) {
376
            throw new \PHP_CodeSniffer_Exception('$stackPtr must be of type T_FUNCTION or T_CLOSURE');
377
        }
378