Skip to content

Commit d4d58f5

Browse files
committed
Implement suggestions from code review
1 parent 45e6cd7 commit d4d58f5

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/Standards/Generic/Sniffs/CodeAnalysis/EmptyPHPStatementSniff.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,8 @@ public function process(File $phpcsFile, $stackPtr)
124124
case 'T_CLOSE_TAG':
125125
$prevNonEmpty = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true);
126126

127-
if ($prevNonEmpty === false
128-
|| ($tokens[$prevNonEmpty]['code'] !== T_OPEN_TAG
129-
&& $tokens[$prevNonEmpty]['code'] !== T_OPEN_TAG_WITH_ECHO)
127+
if ($tokens[$prevNonEmpty]['code'] !== T_OPEN_TAG
128+
&& $tokens[$prevNonEmpty]['code'] !== T_OPEN_TAG_WITH_ECHO
130129
) {
131130
return;
132131
}

src/Standards/Generic/Tests/CodeAnalysis/EmptyPHPStatementUnitTest.2.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Tests with short open echo tag. -->
1+
<!-- Tests with short open tag. -->
22

33
<input name="<? ; something_else(); ?>" />
44
<input name="<? something_else(); ; ?>" />

src/Standards/Generic/Tests/CodeAnalysis/EmptyPHPStatementUnitTest.2.inc.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Tests with short open echo tag. -->
1+
<!-- Tests with short open tag. -->
22

33
<input name="<?something_else(); ?>" />
44
<input name="<? something_else(); ?>" />

0 commit comments

Comments
 (0)