Skip to content

Commit 5636bb6

Browse files
phpstan-botclaude
andcommitted
Remove unused $universalObjectCratesClasses from ImpossibleCheckTypeHelper
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7517f35 commit 5636bb6

18 files changed

Lines changed: 1 addition & 29 deletions

src/Rules/Comparison/ImpossibleCheckTypeHelper.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,10 @@
4444
final class ImpossibleCheckTypeHelper
4545
{
4646

47-
/**
48-
* @param string[] $universalObjectCratesClasses
49-
*/
5047
public function __construct(
5148
private ReflectionProvider $reflectionProvider,
5249
private TypeSpecifier $typeSpecifier,
5350
#[AutowiredParameter]
54-
private array $universalObjectCratesClasses,
55-
#[AutowiredParameter]
5651
private bool $treatPhpDocTypesAsCertain,
5752
)
5853
{
@@ -417,7 +412,6 @@ public function doNotTreatPhpDocTypesAsCertain(): self
417412
return new self(
418413
$this->reflectionProvider,
419414
$this->typeSpecifier,
420-
$this->universalObjectCratesClasses,
421415
false,
422416
);
423417
}

src/Type/Php/TypeSpecifyingFunctionsDynamicReturnTypeExtension.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,10 @@ final class TypeSpecifyingFunctionsDynamicReturnTypeExtension implements Dynamic
2525

2626
private ?ImpossibleCheckTypeHelper $helper = null;
2727

28-
/**
29-
* @param string[] $universalObjectCratesClasses
30-
*/
3128
public function __construct(
3229
private ReflectionProvider $reflectionProvider,
3330
#[AutowiredParameter]
3431
private bool $treatPhpDocTypesAsCertain,
35-
#[AutowiredParameter]
36-
private array $universalObjectCratesClasses,
3732
)
3833
{
3934
}
@@ -76,7 +71,7 @@ public function getTypeFromFunctionCall(
7671

7772
private function getHelper(): ImpossibleCheckTypeHelper
7873
{
79-
return $this->helper ??= new ImpossibleCheckTypeHelper($this->reflectionProvider, $this->typeSpecifier, $this->universalObjectCratesClasses, $this->treatPhpDocTypesAsCertain);
74+
return $this->helper ??= new ImpossibleCheckTypeHelper($this->reflectionProvider, $this->typeSpecifier, $this->treatPhpDocTypesAsCertain);
8075
}
8176

8277
}

tests/PHPStan/Rules/Comparison/BooleanAndConstantConditionRuleTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ protected function getRule(): Rule
2323
new ImpossibleCheckTypeHelper(
2424
self::createReflectionProvider(),
2525
$this->getTypeSpecifier(),
26-
[],
2726
$this->treatPhpDocTypesAsCertain,
2827
),
2928
$this->treatPhpDocTypesAsCertain,

tests/PHPStan/Rules/Comparison/BooleanNotConstantConditionRuleTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ protected function getRule(): Rule
2323
new ImpossibleCheckTypeHelper(
2424
self::createReflectionProvider(),
2525
$this->getTypeSpecifier(),
26-
[],
2726
$this->treatPhpDocTypesAsCertain,
2827
),
2928
$this->treatPhpDocTypesAsCertain,

tests/PHPStan/Rules/Comparison/BooleanOrConstantConditionRuleTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ protected function getRule(): Rule
2424
new ImpossibleCheckTypeHelper(
2525
self::createReflectionProvider(),
2626
$this->getTypeSpecifier(),
27-
[],
2827
$this->treatPhpDocTypesAsCertain,
2928
),
3029
$this->treatPhpDocTypesAsCertain,

tests/PHPStan/Rules/Comparison/DoWhileLoopConstantConditionRuleTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ protected function getRule(): Rule
1818
new ImpossibleCheckTypeHelper(
1919
self::createReflectionProvider(),
2020
$this->getTypeSpecifier(),
21-
[],
2221
$this->shouldTreatPhpDocTypesAsCertain(),
2322
),
2423
$this->shouldTreatPhpDocTypesAsCertain(),

tests/PHPStan/Rules/Comparison/ElseIfConstantConditionRuleTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ protected function getRule(): Rule
2424
new ImpossibleCheckTypeHelper(
2525
self::createReflectionProvider(),
2626
$this->getTypeSpecifier(),
27-
[],
2827
$this->treatPhpDocTypesAsCertain,
2928
),
3029
$this->treatPhpDocTypesAsCertain,

tests/PHPStan/Rules/Comparison/IfConstantConditionRuleTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ protected function getRule(): Rule
2121
new ImpossibleCheckTypeHelper(
2222
self::createReflectionProvider(),
2323
$this->getTypeSpecifier(),
24-
[],
2524
$this->treatPhpDocTypesAsCertain,
2625
),
2726
$this->treatPhpDocTypesAsCertain,

tests/PHPStan/Rules/Comparison/ImpossibleCheckTypeFunctionCallRuleTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use PHPStan\Testing\RuleTestCase;
77
use PHPUnit\Framework\Attributes\DataProvider;
88
use PHPUnit\Framework\Attributes\RequiresPhp;
9-
use stdClass;
109
use function array_filter;
1110
use function array_map;
1211
use function array_values;
@@ -28,7 +27,6 @@ protected function getRule(): Rule
2827
new ImpossibleCheckTypeHelper(
2928
self::createReflectionProvider(),
3029
$this->getTypeSpecifier(),
31-
[stdClass::class],
3230
$this->treatPhpDocTypesAsCertain,
3331
),
3432
new PossiblyImpureTipHelper(true),

tests/PHPStan/Rules/Comparison/ImpossibleCheckTypeGenericOverwriteRuleTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ public function getRule(): Rule
1717
new ImpossibleCheckTypeHelper(
1818
self::createReflectionProvider(),
1919
$this->getTypeSpecifier(),
20-
[],
2120
true,
2221
),
2322
new PossiblyImpureTipHelper(true),

0 commit comments

Comments
 (0)