Skip to content

Commit 83373f9

Browse files
committed
File::findStartOfStatement(): fix some unintentional parse errors in the test case file
1 parent 027c0cb commit 83373f9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

tests/Core/File/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/Core/File/FindStartOfStatementTest.php

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

95-
$this->assertSame(($start - 12), $found);
95+
$this->assertSame(($start - 11), $found);
9696

9797
}//end testClosureAssignment()
9898

@@ -224,7 +224,7 @@ public function testArrowFunctionArrayValue()
224224
$start = $this->getTargetToken('/* testArrowFunctionArrayValue */', T_COMMA);
225225
$found = self::$phpcsFile->findStartOfStatement($start);
226226

227-
$this->assertSame(($start - 9), $found);
227+
$this->assertSame(($start - 7), $found);
228228

229229
}//end testArrowFunctionArrayValue()
230230

0 commit comments

Comments
 (0)