diff --git a/composer.json b/composer.json index 3b89e70..0c115d7 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ ], "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.9.3" + "phpstan/phpstan": "^1.10" }, "require-dev": { "php-parallel-lint/php-parallel-lint": "^1.2", diff --git a/src/Rules/Deprecations/AccessDeprecatedPropertyRule.php b/src/Rules/Deprecations/AccessDeprecatedPropertyRule.php index e8abc19..3e1f88b 100644 --- a/src/Rules/Deprecations/AccessDeprecatedPropertyRule.php +++ b/src/Rules/Deprecations/AccessDeprecatedPropertyRule.php @@ -10,7 +10,6 @@ use PHPStan\Reflection\MissingPropertyFromReflectionException; use PHPStan\Reflection\ReflectionProvider; use PHPStan\Rules\Rule; -use PHPStan\Type\TypeUtils; use function sprintf; /** @@ -44,7 +43,7 @@ public function processNode(Node $node, Scope $scope): array $propertyName = $node->name->name; $propertyAccessedOnType = $scope->getType($node->var); - $referencedClasses = TypeUtils::getDirectClassNames($propertyAccessedOnType); + $referencedClasses = $propertyAccessedOnType->getObjectClassNames(); foreach ($referencedClasses as $referencedClass) { try { diff --git a/src/Rules/Deprecations/CallToDeprecatedMethodRule.php b/src/Rules/Deprecations/CallToDeprecatedMethodRule.php index 53e023f..6ec4e0c 100644 --- a/src/Rules/Deprecations/CallToDeprecatedMethodRule.php +++ b/src/Rules/Deprecations/CallToDeprecatedMethodRule.php @@ -10,7 +10,6 @@ use PHPStan\Reflection\MissingMethodFromReflectionException; use PHPStan\Reflection\ReflectionProvider; use PHPStan\Rules\Rule; -use PHPStan\Type\TypeUtils; use function sprintf; /** @@ -44,7 +43,7 @@ public function processNode(Node $node, Scope $scope): array $methodName = $node->name->name; $methodCalledOnType = $scope->getType($node->var); - $referencedClasses = TypeUtils::getDirectClassNames($methodCalledOnType); + $referencedClasses = $methodCalledOnType->getObjectClassNames(); foreach ($referencedClasses as $referencedClass) { try {