Skip to content

Commit

Permalink
Merge branch 'feature/generic-endfilenewline-check-short-echo-tag' of h…
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed May 17, 2021
2 parents e73bc0f + db1a0a7 commit c475208
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,11 @@ http://pear.php.net/dtd/package-2.0.xsd">
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNewlineUnitTest.4.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNewlineUnitTest.4.inc.fixed" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNewlineUnitTest.5.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNewlineUnitTest.6.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNewlineUnitTest.6.inc.fixed" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNewlineUnitTest.7.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNewlineUnitTest.7.inc.fixed" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNewlineUnitTest.8.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNewlineUnitTest.php" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNoNewlineUnitTest.1.css" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNoNewlineUnitTest.1.css.fixed" role="test" />
Expand Down
5 changes: 4 additions & 1 deletion src/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ class EndFileNewlineSniff 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 @@
<?= 'foo';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?= 'foo';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?= 'foo' ?>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?= 'foo' ?>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?= 'foo' ?>
3 changes: 3 additions & 0 deletions src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public function getErrorList($testFile='')
case 'EndFileNewlineUnitTest.3.css':
case 'EndFileNewlineUnitTest.4.inc':
return [2 => 1];
case 'EndFileNewlineUnitTest.6.inc':
case 'EndFileNewlineUnitTest.7.inc':
return [1 => 1];
default:
return [];
}//end switch
Expand Down

0 comments on commit c475208

Please sign in to comment.