Skip to content

Commit

Permalink
Merge branch 'master' into 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed May 4, 2015
2 parents 672c06e + 462d831 commit 2be6622
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.xml
Expand Up @@ -30,6 +30,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
-- Thanks to Klaus Purer for the patch
- Defined tokens for lower PHP versions are now phpcs-specific string instead of ints
-- Stops conflict with other projects, like PHP_CodeCoverage
- Fixed bug #584 : Squiz.Arrays.ArrayDeclaration sniff gives incorrect NoComma error for multiline string values
</notes>
<contents>
<dir name="/">
Expand Down
8 changes: 8 additions & 0 deletions src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php
Expand Up @@ -826,6 +826,14 @@ public function processMultiLineArray($phpcsFile, $stackPtr, $arrayStart, $array
continue;
}

// Skip to the end of multi-line strings.
if (isset(PHP_CodeSniffer_Tokens::$stringTokens[$tokens[$i]['code']]) === true) {
$i = $phpcsFile->findNext($tokens[$i]['code'], ($i + 1), null, true);
$i--;
$valueLine = $tokens[$i]['line'];
continue;
}

if ($tokens[$i]['code'] === T_OPEN_SHORT_ARRAY) {
$i = $tokens[$i]['bracket_closer'];
$valueLine = $tokens[$i]['line'];
Expand Down
Expand Up @@ -319,3 +319,12 @@ array(
'2',
)
);

$var = array(
'tab_template' => '
<li>%s</li>',
'panel_template' => '
<div id="%s">
%s
</div>',
);
Expand Up @@ -336,3 +336,12 @@ array(
'2',
),
);

$var = array(
'tab_template' => '
<li>%s</li>',
'panel_template' => '
<div id="%s">
%s
</div>',
);
Expand Up @@ -311,3 +311,12 @@ $ids = [
'2',
]
];

$var = [
'tab_template' => '
<li>%s</li>',
'panel_template' => '
<div id="%s">
%s
</div>',
];
Expand Up @@ -330,3 +330,12 @@ $ids = [
'2',
],
];

$var = [
'tab_template' => '
<li>%s</li>',
'panel_template' => '
<div id="%s">
%s
</div>',
];

0 comments on commit 2be6622

Please sign in to comment.