Skip to content

Commit 01a1592

Browse files
committed
Generic/LanguageConstructSpacing: add extra test
Just safeguarding that the sniff doesn't trigger on closure `use`.
1 parent 59ec82e commit 01a1592

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.1.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,7 @@ yield
9898
yield
9999
// phpcs:ignore Stnd.Category.SniffName
100100
from $test();
101+
102+
// Closure use should be ignored. These are subject to their own rules.
103+
$cl = function() use ($b) {};
104+
$cl = function() use($b) {};

src/Standards/Generic/Tests/WhiteSpace/LanguageConstructSpacingUnitTest.1.inc.fixed

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,7 @@ yield
9292
yield
9393
// phpcs:ignore Stnd.Category.SniffName
9494
from $test();
95+
96+
// Closure use should be ignored. These are subject to their own rules.
97+
$cl = function() use ($b) {};
98+
$cl = function() use($b) {};

0 commit comments

Comments
 (0)