Skip to content

Commit 425b316

Browse files
committed
thos property can be defined in __construct
1 parent 85c94c6 commit 425b316

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

src/Router/Group.php

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,17 @@
88

99
final class Group implements GroupInterface
1010
{
11-
/**
12-
* @var array<MiddlewareInterface>
13-
*/
14-
private array $middlewares;
15-
16-
/**
17-
* @var array<GroupInterface|RouteInterface>
18-
*/
19-
private array $children;
20-
2111
/**
2212
* @param array<GroupInterface|RouteInterface> $children
2313
* @param array<MiddlewareInterface> $middlewares
2414
* @param array<string, mixed> $pathOptions
2515
*/
2616
private function __construct(
2717
private string $path,
28-
array $children = [],
29-
array $middlewares = [],
18+
private array $children = [],
19+
private array $middlewares = [],
3020
private array $pathOptions = []
31-
) {
32-
$this->children = $children;
33-
$this->middlewares = $middlewares;
34-
}
21+
) {}
3522

3623
/**
3724
* @param array<GroupInterface|RouteInterface> $children

0 commit comments

Comments
 (0)