From cac2a3da4988f173e0a5a27ee4a618be8bb002f0 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Wed, 23 Apr 2025 09:20:00 +0200 Subject: [PATCH 1/2] Micro optimize LazyInternalScopeFactory --- src/Analyser/LazyInternalScopeFactory.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Analyser/LazyInternalScopeFactory.php b/src/Analyser/LazyInternalScopeFactory.php index 1d4154261d..15734c1454 100644 --- a/src/Analyser/LazyInternalScopeFactory.php +++ b/src/Analyser/LazyInternalScopeFactory.php @@ -17,10 +17,16 @@ final class LazyInternalScopeFactory implements InternalScopeFactory { + /** + * @var int|array{min: int, max: int}|null + */ + private int|array|null $phpVersion; + public function __construct( private Container $container, ) { + $this->phpVersion = $this->container->getParameter('phpVersion'); } public function create( @@ -58,7 +64,7 @@ public function create( $context, $this->container->getByType(PhpVersion::class), $this->container->getByType(AttributeReflectionFactory::class), - $this->container->getParameter('phpVersion'), + $this->phpVersion, $declareStrictTypes, $function, $namespace, From ffb4e1decf5ba5b4eaf042eb211aad84c8f18132 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Wed, 23 Apr 2025 09:35:07 +0200 Subject: [PATCH 2/2] cs --- src/Analyser/LazyInternalScopeFactory.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Analyser/LazyInternalScopeFactory.php b/src/Analyser/LazyInternalScopeFactory.php index 15734c1454..9835fb1591 100644 --- a/src/Analyser/LazyInternalScopeFactory.php +++ b/src/Analyser/LazyInternalScopeFactory.php @@ -17,9 +17,7 @@ final class LazyInternalScopeFactory implements InternalScopeFactory { - /** - * @var int|array{min: int, max: int}|null - */ + /** @var int|array{min: int, max: int}|null */ private int|array|null $phpVersion; public function __construct(