Skip to content

Commit

Permalink
Merge branch 'feature/generic-endfilenonewline-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 c475208 + 1d845a1 commit a1d1f03
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 @@ -579,6 +579,11 @@ http://pear.php.net/dtd/package-2.0.xsd">
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNoNewlineUnitTest.6.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNoNewlineUnitTest.6.inc.fixed" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNoNewlineUnitTest.7.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNoNewlineUnitTest.8.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNoNewlineUnitTest.8.inc.fixed" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNoNewlineUnitTest.9.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNoNewlineUnitTest.9.inc.fixed" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNoNewlineUnitTest.10.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNoNewlineUnitTest.php" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="ExecutableFileUnitTest.1.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="ExecutableFileUnitTest.2.inc" role="test" />
Expand Down
5 changes: 4 additions & 1 deletion src/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ class EndFileNoNewlineSniff 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'; ?>
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public function getErrorList($testFile='')
case 'EndFileNoNewlineUnitTest.2.js':
case 'EndFileNoNewlineUnitTest.6.inc':
return [2 => 1];
case 'EndFileNoNewlineUnitTest.8.inc':
case 'EndFileNoNewlineUnitTest.9.inc':
return [1 => 1];
default:
return [];
}//end switch
Expand Down

0 comments on commit a1d1f03

Please sign in to comment.