Skip to content

Commit

Permalink
Fixes after PHPStan update
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Oct 7, 2024
1 parent d1e08ac commit 237165e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/Rules/Symfony/ContainerInterfacePrivateServiceRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ public function processNode(Node $node, Scope $scope): array
private function isServiceSubscriber(Type $containerType, Scope $scope): TrinaryLogic
{
$serviceSubscriberInterfaceType = new ObjectType('Symfony\Contracts\Service\ServiceSubscriberInterface');
$isContainerServiceSubscriber = $serviceSubscriberInterfaceType->isSuperTypeOf($containerType);
$isContainerServiceSubscriber = $serviceSubscriberInterfaceType->isSuperTypeOf($containerType)->result;
$classReflection = $scope->getClassReflection();
if ($classReflection === null) {
return $isContainerServiceSubscriber;
}
$containedClassType = new ObjectType($classReflection->getName());
return $isContainerServiceSubscriber->or($serviceSubscriberInterfaceType->isSuperTypeOf($containedClassType));
return $isContainerServiceSubscriber->or($serviceSubscriberInterfaceType->isSuperTypeOf($containedClassType)->result);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ public function getTypeFromMethodCall(
$firstArgType = $scope->getType($methodCall->getArgs()[0]->value);
$secondArgType = $scope->getType($methodCall->getArgs()[1]->value);

$firstIsTrueType = (new ConstantBooleanType(true))->isSuperTypeOf($firstArgType);
$firstIsFalseType = (new ConstantBooleanType(false))->isSuperTypeOf($firstArgType);
$secondIsTrueType = (new ConstantBooleanType(true))->isSuperTypeOf($secondArgType);
$secondIsFalseType = (new ConstantBooleanType(false))->isSuperTypeOf($secondArgType);
$firstIsTrueType = (new ConstantBooleanType(true))->isSuperTypeOf($firstArgType)->result;
$firstIsFalseType = (new ConstantBooleanType(false))->isSuperTypeOf($firstArgType)->result;
$secondIsTrueType = (new ConstantBooleanType(true))->isSuperTypeOf($secondArgType)->result;
$secondIsFalseType = (new ConstantBooleanType(false))->isSuperTypeOf($secondArgType)->result;

$firstCompareType = $firstIsTrueType->compareTo($firstIsFalseType);
$secondCompareType = $secondIsTrueType->compareTo($secondIsFalseType);
Expand Down
4 changes: 2 additions & 2 deletions src/Type/Symfony/HeaderBagDynamicReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public function getTypeFromMethodCall(
): ?Type
{
$firstArgType = isset($methodCall->getArgs()[2]) ? $scope->getType($methodCall->getArgs()[2]->value) : new ConstantBooleanType(true);
$isTrueType = (new ConstantBooleanType(true))->isSuperTypeOf($firstArgType);
$isFalseType = (new ConstantBooleanType(false))->isSuperTypeOf($firstArgType);
$isTrueType = (new ConstantBooleanType(true))->isSuperTypeOf($firstArgType)->result;
$isFalseType = (new ConstantBooleanType(false))->isSuperTypeOf($firstArgType)->result;
$compareTypes = $isTrueType->compareTo($isFalseType);

if ($compareTypes === $isTrueType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public function getTypeFromMethodCall(
): ?Type
{
$firstArgType = isset($methodCall->getArgs()[2]) ? $scope->getType($methodCall->getArgs()[2]->value) : new ConstantBooleanType(true);
$isTrueType = (new ConstantBooleanType(true))->isSuperTypeOf($firstArgType);
$isFalseType = (new ConstantBooleanType(false))->isSuperTypeOf($firstArgType);
$isTrueType = (new ConstantBooleanType(true))->isSuperTypeOf($firstArgType)->result;
$isFalseType = (new ConstantBooleanType(false))->isSuperTypeOf($firstArgType)->result;
$compareTypes = $isTrueType->compareTo($isFalseType);

if ($compareTypes === $isTrueType) {
Expand Down
4 changes: 2 additions & 2 deletions src/Type/Symfony/RequestDynamicReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public function getTypeFromMethodCall(
}

$argType = $scope->getType($methodCall->getArgs()[0]->value);
$isTrueType = (new ConstantBooleanType(true))->isSuperTypeOf($argType);
$isFalseType = (new ConstantBooleanType(false))->isSuperTypeOf($argType);
$isTrueType = (new ConstantBooleanType(true))->isSuperTypeOf($argType)->result;
$isFalseType = (new ConstantBooleanType(false))->isSuperTypeOf($argType)->result;
$compareTypes = $isTrueType->compareTo($isFalseType);
if ($compareTypes === $isTrueType) {
return new ResourceType();
Expand Down

0 comments on commit 237165e

Please sign in to comment.