Skip to content

Commit

Permalink
Remove useless foreach key and cast string on test
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Jan 17, 2025
1 parent d4fce83 commit aa802a5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/PhpParser/CodeTestParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function ($matches) {
// multiple sections possible with always two forming a pair
$chunks = array_chunk($parts, $chunksPerTest);
$tests = [];
foreach ($chunks as $i => $chunk) {
foreach ($chunks as $chunk) {
$lastPart = array_pop($chunk);
list($lastPart, $mode) = $this->extractMode($lastPart);
$tests[] = [$mode, array_merge($chunk, [$lastPart])];
Expand Down Expand Up @@ -61,7 +61,7 @@ private function extractMode(string $expected): array {
return [$expected, null];
}

$expected = (string) substr($expected, $firstNewLine + 1);
$expected = substr($expected, $firstNewLine + 1);
return [$expected, substr($firstLine, 2)];
}
}
2 changes: 1 addition & 1 deletion test/PhpParser/Node/Scalar/DNumberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function testRawValue(): void {
$lLumber = $echo->exprs[0];
$this->assertInstanceOf(Float_::class, $lLumber);

/** @var Float_ $dnumber */
/** @var Float_ $lLumber */
$this->assertSame(1234.56, $lLumber->value);
$this->assertSame('1_234.56', $lLumber->getAttribute('rawValue'));
}
Expand Down
2 changes: 1 addition & 1 deletion test/PhpParser/Node/Scalar/NumberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function testRawValue(): void {
$lLumber = $echo->exprs[0];
$this->assertInstanceOf(Int_::class, $lLumber);

/** @var Int_ $lnumber */
/** @var Int_ $lLumber */
$this->assertSame(1234, $lLumber->value);
$this->assertSame('1_234', $lLumber->getAttribute('rawValue'));
}
Expand Down

0 comments on commit aa802a5

Please sign in to comment.