Skip to content

Commit ddc1c2a

Browse files
committed
Minor refactoring of nodes
1 parent 8a41917 commit ddc1c2a

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

src/TokenParser/BreakNode.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@
99
#[YieldReady]
1010
class BreakNode extends Node
1111
{
12-
private int $loopNumber = 1;
13-
14-
public function __construct(int $loopNumber, int $lineno)
15-
{
12+
public function __construct(
13+
private readonly int $loopNumber,
14+
int $lineno,
15+
) {
1616
parent::__construct([], [], $lineno);
17-
18-
$this->loopNumber = $loopNumber;
1917
}
2018

2119
public function compile(Compiler $compiler): void

src/TokenParser/ContinueNode.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@
99
#[YieldReady]
1010
class ContinueNode extends Node
1111
{
12-
private int $loopNumber = 1;
13-
14-
public function __construct(int $loopNumber, int $lineno)
15-
{
12+
public function __construct(
13+
private readonly int $loopNumber,
14+
int $lineno,
15+
) {
1616
parent::__construct([], [], $lineno);
17-
18-
$this->loopNumber = $loopNumber;
1917
}
2018

2119
public function compile(Compiler $compiler): void

0 commit comments

Comments
 (0)