Skip to content

Commit d2b7e81

Browse files
authored
Micro optimize LazyInternalScopeFactory
1 parent 72e37dc commit d2b7e81

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Analyser/LazyInternalScopeFactory.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@
1717
final class LazyInternalScopeFactory implements InternalScopeFactory
1818
{
1919

20+
/** @var int|array{min: int, max: int}|null */
21+
private int|array|null $phpVersion;
22+
2023
public function __construct(
2124
private Container $container,
2225
)
2326
{
27+
$this->phpVersion = $this->container->getParameter('phpVersion');
2428
}
2529

2630
public function create(
@@ -58,7 +62,7 @@ public function create(
5862
$context,
5963
$this->container->getByType(PhpVersion::class),
6064
$this->container->getByType(AttributeReflectionFactory::class),
61-
$this->container->getParameter('phpVersion'),
65+
$this->phpVersion,
6266
$declareStrictTypes,
6367
$function,
6468
$namespace,

0 commit comments

Comments
 (0)