Skip to content

Commit 3366736

Browse files
committed
use constructor property promotion
1 parent bd1d9e5 commit 3366736

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ServiceLocatorTrait.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,15 @@ class_exists(NotFoundExceptionInterface::class);
2626
*/
2727
trait ServiceLocatorTrait
2828
{
29-
private array $factories;
3029
private array $loading = [];
3130
private array $providedTypes;
3231

3332
/**
3433
* @param array<string, callable> $factories
3534
*/
36-
public function __construct(array $factories)
37-
{
38-
$this->factories = $factories;
35+
public function __construct(
36+
private array $factories,
37+
) {
3938
}
4039

4140
public function has(string $id): bool

0 commit comments

Comments
 (0)