Skip to content

Commit

Permalink
Merge branch 'feature/psr2-endfilenewline-check-short-echo-tag' of ht…
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed May 17, 2021
2 parents 6be01f6 + b094c94 commit 7aa6838
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 1 deletion.
7 changes: 7 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1330,6 +1330,13 @@ http://pear.php.net/dtd/package-2.0.xsd">
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNewlineUnitTest.9.inc.fixed" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNewlineUnitTest.10.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNewlineUnitTest.10.inc.fixed" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNewlineUnitTest.11.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNewlineUnitTest.11.inc.fixed" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNewlineUnitTest.12.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNewlineUnitTest.12.inc.fixed" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNewlineUnitTest.13.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNewlineUnitTest.13.inc.fixed" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNewlineUnitTest.14.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="EndFileNewlineUnitTest.php" role="test" />
</dir>
<dir name="Methods">
Expand Down
5 changes: 4 additions & 1 deletion src/Standards/PSR2/Sniffs/Files/EndFileNewlineSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,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' ?>
5 changes: 5 additions & 0 deletions src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.13.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?= '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' ?>
4 changes: 4 additions & 0 deletions src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public function getErrorList($testFile='')
case 'EndFileNewlineUnitTest.9.inc':
case 'EndFileNewlineUnitTest.10.inc':
return [2 => 1];
case 'EndFileNewlineUnitTest.11.inc':
case 'EndFileNewlineUnitTest.12.inc':
case 'EndFileNewlineUnitTest.13.inc':
return [1 => 1];
default:
return [];
}//end switch
Expand Down

0 comments on commit 7aa6838

Please sign in to comment.