Skip to content

Commit bcc1e8c

Browse files
herndlmondrejmirtes
authored andcommittedJan 17, 2023
Fix deprecations and require PHPStan ^1.10
1 parent 0f05c71 commit bcc1e8c

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed
 

‎composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
],
88
"require": {
99
"php": "^7.2 || ^8.0",
10-
"phpstan/phpstan": "^1.9.3"
10+
"phpstan/phpstan": "^1.10"
1111
},
1212
"require-dev": {
1313
"php-parallel-lint/php-parallel-lint": "^1.2",

‎src/Rules/Deprecations/AccessDeprecatedPropertyRule.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use PHPStan\Reflection\MissingPropertyFromReflectionException;
1111
use PHPStan\Reflection\ReflectionProvider;
1212
use PHPStan\Rules\Rule;
13-
use PHPStan\Type\TypeUtils;
1413
use function sprintf;
1514

1615
/**
@@ -44,7 +43,7 @@ public function processNode(Node $node, Scope $scope): array
4443

4544
$propertyName = $node->name->name;
4645
$propertyAccessedOnType = $scope->getType($node->var);
47-
$referencedClasses = TypeUtils::getDirectClassNames($propertyAccessedOnType);
46+
$referencedClasses = $propertyAccessedOnType->getObjectClassNames();
4847

4948
foreach ($referencedClasses as $referencedClass) {
5049
try {

‎src/Rules/Deprecations/CallToDeprecatedMethodRule.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use PHPStan\Reflection\MissingMethodFromReflectionException;
1111
use PHPStan\Reflection\ReflectionProvider;
1212
use PHPStan\Rules\Rule;
13-
use PHPStan\Type\TypeUtils;
1413
use function sprintf;
1514

1615
/**
@@ -44,7 +43,7 @@ public function processNode(Node $node, Scope $scope): array
4443

4544
$methodName = $node->name->name;
4645
$methodCalledOnType = $scope->getType($node->var);
47-
$referencedClasses = TypeUtils::getDirectClassNames($methodCalledOnType);
46+
$referencedClasses = $methodCalledOnType->getObjectClassNames();
4847

4948
foreach ($referencedClasses as $referencedClass) {
5049
try {

0 commit comments

Comments
 (0)
Failed to load comments.