Code Duplication    Length = 5-6 lines in 2 locations

build/CodeIgniter/Sniffs/Strings/DoubleQuoteUsageSniff.php 2 locations

@@ 116-120 (lines=5) @@
113
					}
114
					// don't move forward, since it will be done in the main loop
115
					// $strPtr++;
116
				} else if (T_VARIABLE === $strToken[0]) {
117
					$variableFound = TRUE;
118
					$error = "Variable {$strToken[1]} in double-quoted strings should be enclosed with curly braces. Please consider {{$strToken[1]}}";
119
					$phpcsFile->addError($error, $stackPtr);
120
				}
121
			}
122
			$strPtr++;
123
		}
@@ 146-151 (lines=6) @@
143
		$strPtr = 1; // skip php opening tag added by ourselves
144
		while ($strPtr < count($strTokens)) {
145
			$strToken = $strTokens[$strPtr];
146
			if (is_array($strToken)) {
147
				if (T_VARIABLE === $strToken[0]) {
148
					$error = "Variables like {$strToken[1]} should be in double-quoted strings only.";
149
					$phpcsFile->addError($error, $stackPtr);
150
				}
151
			}
152
			$strPtr++;
153
		}
154
		return $variableFound;