Skip to content

Commit 5091c3a

Browse files
committed
Micro optimize LazyInternalScopeFactory
1 parent 1f54e5a commit 5091c3a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Analyser/LazyInternalScopeFactory.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,16 @@
1717
final class LazyInternalScopeFactory implements InternalScopeFactory
1818
{
1919

20+
/**
21+
* @var int|array{min: int, max: int}|null
22+
*/
23+
private int|array|null $phpVersion;
24+
2025
public function __construct(
2126
private Container $container,
2227
)
2328
{
29+
$this->phpVersion = $this->container->getParameter('phpVersion');
2430
}
2531

2632
public function create(
@@ -58,7 +64,7 @@ public function create(
5864
$context,
5965
$this->container->getByType(PhpVersion::class),
6066
$this->container->getByType(AttributeReflectionFactory::class),
61-
$this->container->getParameter('phpVersion'),
67+
$this->phpVersion,
6268
$declareStrictTypes,
6369
$function,
6470
$namespace,

0 commit comments

Comments
 (0)