Skip to content

Commit b72362d

Browse files
committed
Tests/BCFile::findStartOfStatement(): sync in test fixes from upstream [4]
See PR PHPCSStandards/PHP_CodeSniffer 509 / PHPCSStandards/PHP_CodeSniffer@83373f9
1 parent ad950eb commit b72362d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Tests/BackCompat/BCFile/FindStartOfStatementTest.inc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ while(true) {}
1414
$a = 1;
1515

1616
/* testClosureAssignment */
17-
$a = function($b=false;){};
17+
$a = function($b=false){};
1818

1919
/* testHeredocFunctionArg */
2020
myFunction(<<<END
@@ -39,8 +39,8 @@ use Vendor\Package\{ClassA as A, ClassB, ClassC as C};
3939

4040
$a = [
4141
/* testArrowFunctionArrayValue */
42-
'a' => fn() => return 1,
43-
'b' => fn() => return 1,
42+
'a' => fn() => 1,
43+
'b' => fn() => 1,
4444
];
4545

4646
/* testStaticArrowFunction */
@@ -139,11 +139,11 @@ switch ($foo) {
139139
/* testInsideCaseStatement */
140140
$var = doSomething();
141141
/* testInsideCaseBreakStatement */
142-
break 2;
142+
break 1;
143143

144144
case 2:
145145
/* testInsideCaseContinueStatement */
146-
continue 2;
146+
continue 1;
147147

148148
case 3:
149149
/* testInsideCaseReturnStatement */

Tests/BackCompat/BCFile/FindStartOfStatementTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function testClosureAssignment()
8585
$start = $this->getTargetToken('/* testClosureAssignment */', T_CLOSE_CURLY_BRACKET);
8686
$found = BCFile::findStartOfStatement(self::$phpcsFile, $start);
8787

88-
$this->assertSame(($start - 12), $found);
88+
$this->assertSame(($start - 11), $found);
8989
}
9090

9191
/**
@@ -208,7 +208,7 @@ public function testArrowFunctionArrayValue()
208208
$start = $this->getTargetToken('/* testArrowFunctionArrayValue */', T_COMMA);
209209
$found = BCFile::findStartOfStatement(self::$phpcsFile, $start);
210210

211-
$this->assertSame(($start - 9), $found);
211+
$this->assertSame(($start - 7), $found);
212212
}
213213

214214
/**

0 commit comments

Comments
 (0)