Skip to content

Commit

Permalink
Merge branch 'feature/generic-disallowtabindent-check-short-echo-tag'…
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed May 17, 2021
2 parents e04ecd0 + 551cdf7 commit 6be01f6
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 5 deletions.
6 changes: 4 additions & 2 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,10 @@ http://pear.php.net/dtd/package-2.0.xsd">
<file baseinstalldir="PHP/CodeSniffer" name="DisallowSpaceIndentUnitTest.php" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="DisallowTabIndentUnitTest.css" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="DisallowTabIndentUnitTest.css.fixed" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="DisallowTabIndentUnitTest.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="DisallowTabIndentUnitTest.inc.fixed" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="DisallowTabIndentUnitTest.1.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="DisallowTabIndentUnitTest.1.inc.fixed" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="DisallowTabIndentUnitTest.2.inc" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="DisallowTabIndentUnitTest.2.inc.fixed" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="DisallowTabIndentUnitTest.js" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="DisallowTabIndentUnitTest.js.fixed" role="test" />
<file baseinstalldir="PHP/CodeSniffer" name="DisallowTabIndentUnitTest.php" role="test" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ class DisallowTabIndentSniff 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 @@
<?=
"$hello $there";
?>
<html>
<head>
<title>Foo</title>
</head>
<body>
<div>
<div>
<div>
</div>
</div>
</div>
</body>
</html>

<?=
"$hello $there";
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?=
"$hello $there";
?>
<html>
<head>
<title>Foo</title>
</head>
<body>
<div>
<div>
<div>
</div>
</div>
</div>
</body>
</html>

<?=
"$hello $there";
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ public function setCliValues($testFile, $config)
*
* @return array<int, int>
*/
public function getErrorList($testFile='DisallowTabIndentUnitTest.inc')
public function getErrorList($testFile='')
{
switch ($testFile) {
case 'DisallowTabIndentUnitTest.inc':
case 'DisallowTabIndentUnitTest.1.inc':
return [
5 => 2,
9 => 1,
Expand Down Expand Up @@ -84,6 +84,19 @@ public function getErrorList($testFile='DisallowTabIndentUnitTest.inc')
93 => 1,
];
break;
case 'DisallowTabIndentUnitTest.2.inc':
return [
6 => 1,
7 => 1,
8 => 1,
9 => 1,
10 => 1,
11 => 1,
12 => 1,
13 => 1,
19 => 1,
];
break;
case 'DisallowTabIndentUnitTest.js':
return [
3 => 1,
Expand Down

0 comments on commit 6be01f6

Please sign in to comment.