Skip to content

Commit

Permalink
Merge branch 'feature/generic-gitmergeconflict-check-short-echo-tag' of
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed May 17, 2021
2 parents bd03017 + a9a1c4c commit 5852f49
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
<file baseinstalldir="PHP/CodeSniffer" name="GitMergeConflictUnitTest.4.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="GitMergeConflictUnitTest.5.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="GitMergeConflictUnitTest.6.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="GitMergeConflictUnitTest.7.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="GitMergeConflictUnitTest.js" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="GitMergeConflictUnitTest.php" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="SubversionPropertiesUnitTest.inc" role="test" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ class GitMergeConflictSniff implements Sniff
*/
public function register()
{
return [T_OPEN_TAG];
return [
T_OPEN_TAG,
T_OPEN_TAG_WITH_ECHO,
];

}//end register()

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!-- Test detecting merge conflicts in inline HTML. -->
<div class="abc">
<<<<<<< HEAD
<p id="test-this">Testing a merge conflict.</p>
=======
<p id="test-that">Another text string.</p>
>>>>>>> ref/heads/feature-branch
</div>

<!-- Test detecting merge conflicts in inline HTML. -->
<div class="abc">
<<<<<<< HEAD
<p id="test-this"><?= 'Testing a merge conflict.'; ?></p>
=======
<p id="test-that"><?= 'Another text string.'; ?></p>
>>>>>>> ref/heads/feature-branch
</div>

<?= $text; ?>
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@ public function getErrorList($testFile='GitMergeConflictUnitTest.1.inc')
32 => 1,
];

case 'GitMergeConflictUnitTest.7.inc':
return [
3 => 1,
5 => 1,
7 => 1,
12 => 1,
14 => 1,
16 => 1,
];

case 'GitMergeConflictUnitTest.1.css':
return [
3 => 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public function register()
{
return [
T_OPEN_TAG,
T_OPEN_TAG_WITH_ECHO,
T_CLOSE_TAG,
T_WHITESPACE,
T_COMMENT,
Expand Down

0 comments on commit 5852f49

Please sign in to comment.