From 77f6465770ecd0be9a0efc483406dd5fa0b591b2 Mon Sep 17 00:00:00 2001 From: Martin Herndl Date: Sun, 20 Nov 2022 21:39:05 +0100 Subject: [PATCH] Remove unused `$explicitMixedForGlobalVariables` arg from `MutatingScope` --- src/Analyser/DirectInternalScopeFactory.php | 2 -- src/Analyser/LazyInternalScopeFactory.php | 4 ---- src/Analyser/MutatingScope.php | 2 -- src/Testing/PHPStanTestCase.php | 1 - 4 files changed, 9 deletions(-) diff --git a/src/Analyser/DirectInternalScopeFactory.php b/src/Analyser/DirectInternalScopeFactory.php index b1a27020cce..3e8fc861a45 100644 --- a/src/Analyser/DirectInternalScopeFactory.php +++ b/src/Analyser/DirectInternalScopeFactory.php @@ -34,7 +34,6 @@ public function __construct( private bool $treatPhpDocTypesAsCertain, private PhpVersion $phpVersion, private bool $explicitMixedInUnknownGenericNew, - private bool $explicitMixedForGlobalVariables, private ConstantResolver $constantResolver, ) { @@ -103,7 +102,6 @@ public function create( $parentScope, $nativeTypesPromoted, $this->explicitMixedInUnknownGenericNew, - $this->explicitMixedForGlobalVariables, ); } diff --git a/src/Analyser/LazyInternalScopeFactory.php b/src/Analyser/LazyInternalScopeFactory.php index ad285640497..292aff201c1 100644 --- a/src/Analyser/LazyInternalScopeFactory.php +++ b/src/Analyser/LazyInternalScopeFactory.php @@ -22,8 +22,6 @@ class LazyInternalScopeFactory implements InternalScopeFactory private bool $explicitMixedInUnknownGenericNew; - private bool $explicitMixedForGlobalVariables; - /** * @param class-string $scopeClass */ @@ -34,7 +32,6 @@ public function __construct( { $this->treatPhpDocTypesAsCertain = $container->getParameter('treatPhpDocTypesAsCertain'); $this->explicitMixedInUnknownGenericNew = $this->container->getParameter('featureToggles')['explicitMixedInUnknownGenericNew']; - $this->explicitMixedForGlobalVariables = $this->container->getParameter('featureToggles')['explicitMixedForGlobalVariables']; } /** @@ -100,7 +97,6 @@ public function create( $parentScope, $nativeTypesPromoted, $this->explicitMixedInUnknownGenericNew, - $this->explicitMixedForGlobalVariables, ); } diff --git a/src/Analyser/MutatingScope.php b/src/Analyser/MutatingScope.php index 01f8e863879..fee3a4425be 100644 --- a/src/Analyser/MutatingScope.php +++ b/src/Analyser/MutatingScope.php @@ -190,7 +190,6 @@ public function __construct( private ?Scope $parentScope = null, private bool $nativeTypesPromoted = false, private bool $explicitMixedInUnknownGenericNew = false, - private bool $explicitMixedForGlobalVariables = false, ) { if ($namespace === '') { @@ -2150,7 +2149,6 @@ public function doNotTreatPhpDocTypesAsCertain(): Scope $this->parentScope, false, $this->explicitMixedInUnknownGenericNew, - $this->explicitMixedForGlobalVariables, ); } diff --git a/src/Testing/PHPStanTestCase.php b/src/Testing/PHPStanTestCase.php index d35a589ff07..8fe8581f8ed 100644 --- a/src/Testing/PHPStanTestCase.php +++ b/src/Testing/PHPStanTestCase.php @@ -178,7 +178,6 @@ public function createScopeFactory(ReflectionProvider $reflectionProvider, TypeS $this->shouldTreatPhpDocTypesAsCertain(), $container->getByType(PhpVersion::class), $container->getParameter('featureToggles')['explicitMixedInUnknownGenericNew'], - $container->getParameter('featureToggles')['explicitMixedForGlobalVariables'], $constantResolver, ), $container->getParameter('featureToggles')['explicitMixedForGlobalVariables'],