Skip to content

Commit

Permalink
Fix deprecations and require PHPStan ^1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
herndlm authored and ondrejmirtes committed Jan 17, 2023
1 parent 0f05c71 commit bcc1e8c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions src/Rules/Deprecations/AccessDeprecatedPropertyRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use PHPStan\Reflection\MissingPropertyFromReflectionException;
use PHPStan\Reflection\ReflectionProvider;
use PHPStan\Rules\Rule;
use PHPStan\Type\TypeUtils;
use function sprintf;

/**
Expand Down Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions src/Rules/Deprecations/CallToDeprecatedMethodRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use PHPStan\Reflection\MissingMethodFromReflectionException;
use PHPStan\Reflection\ReflectionProvider;
use PHPStan\Rules\Rule;
use PHPStan\Type\TypeUtils;
use function sprintf;

/**
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit bcc1e8c

Please sign in to comment.