Code Duplication    Length = 3-4 lines in 5 locations

PHPCompatibility/Sniffs/PHP/NewLanguageConstructsSniff.php 3 locations

@@ 260-263 (lines=4) @@
257
     */
258
    private function isTCoalesceEqual($tokens, $stackPtr)
259
    {
260
        if ($tokens[$stackPtr]['code'] !== T_EQUAL || isset($tokens[($stackPtr - 1)]) === false) {
261
            // Function called for wrong token or token has no predecesor.
262
            return false;
263
        }
264
265
        if ($tokens[($stackPtr - 1)]['type'] === 'T_COALESCE') {
266
            return true;
@@ 287-290 (lines=4) @@
284
     */
285
    private function isTCoalesce($tokens, $stackPtr)
286
    {
287
        if ($tokens[$stackPtr]['code'] !== T_INLINE_THEN || isset($tokens[($stackPtr - 1)]) === false) {
288
            // Function called for wrong token or token has no predecesor.
289
            return false;
290
        }
291
292
        if ($tokens[($stackPtr - 1)]['code'] === T_INLINE_THEN) {
293
            // Make sure not to confuse it with the T_COALESCE_EQUAL token.
@@ 294-296 (lines=3) @@
291
292
        if ($tokens[($stackPtr - 1)]['code'] === T_INLINE_THEN) {
293
            // Make sure not to confuse it with the T_COALESCE_EQUAL token.
294
            if (isset($tokens[($stackPtr + 1)]) === false || $tokens[($stackPtr + 1)]['code'] !== T_EQUAL) {
295
                return true;
296
            }
297
        }
298
299
        return false;

PHPCompatibility/Sniffs/PHP/NewNowdocQuotedHeredocSniff.php 2 locations

@@ 105-107 (lines=3) @@
102
            /*
103
             * Check for the right token combination.
104
             */
105
            if (isset($tokens[($stackPtr + 1)]) === false || $tokens[($stackPtr + 1)]['code'] !== T_LESS_THAN) {
106
                return;
107
            }
108
109
            if (isset($tokens[($stackPtr + 2)]) === false
110
                || $tokens[($stackPtr + 2)]['code'] !== T_CONSTANT_ENCAPSED_STRING) {
@@ 109-112 (lines=4) @@
106
                return;
107
            }
108
109
            if (isset($tokens[($stackPtr + 2)]) === false
110
                || $tokens[($stackPtr + 2)]['code'] !== T_CONSTANT_ENCAPSED_STRING) {
111
                return;
112
            }
113
114
            /*
115
             * Heredoc and nowdoc naming rules: