Skip to content

Commit

Permalink
Merge branch 'feature/generic-executablefile-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 fde816c + f6d4010 commit 293aa66
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
<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" />
<file baseinstalldir="PHP/CodeSniffer" name="ExecutableFileUnitTest.3.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="ExecutableFileUnitTest.4.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="ExecutableFileUnitTest.php" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="InlineHTMLUnitTest.1.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="InlineHTMLUnitTest.2.inc" role="test" />
Expand Down
5 changes: 4 additions & 1 deletion src/Standards/Generic/Sniffs/Files/ExecutableFileSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ class ExecutableFileSniff 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 @@
<?= 'text' ?>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?= 'text' ?>
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function getErrorList($testFile='')
{
switch ($testFile) {
case 'ExecutableFileUnitTest.2.inc':
case 'ExecutableFileUnitTest.4.inc':
return [1 => 1];
default:
return [];
Expand Down

0 comments on commit 293aa66

Please sign in to comment.