Skip to content
Merged

Rectify #7852

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Rector\Php81\NodeManipulator;

use PHPStan\Analyser\Fiber\FiberScope;
use PhpParser\Node\Arg;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\Cast\Int_ as CastInt_;
Expand All @@ -16,6 +15,7 @@
use PhpParser\Node\Scalar\Int_;
use PhpParser\Node\Scalar\InterpolatedString;
use PhpParser\Node\Scalar\String_;
use PHPStan\Analyser\Fiber\FiberScope;
use PHPStan\Analyser\Scope;
use PHPStan\Reflection\Native\ExtendedNativeParameterReflection;
use PHPStan\Reflection\ParametersAcceptor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use PHPStan\Reflection\MethodReflection;
use PHPStan\Reflection\ParameterReflection;
use PHPStan\Reflection\ParametersAcceptorSelector;
use PHPStan\Reflection\Php\PhpPropertyReflection;
use PHPStan\Type\MixedType;
use PHPStan\Type\NeverType;
use PHPStan\Type\Type;
Expand Down Expand Up @@ -154,7 +155,8 @@ private function areFunctionReturnsTypeSafe(FunctionLike $functionLike): bool
if (
$declaredReturnType instanceof MixedType
|| $declaredReturnType instanceof NeverType
|| $declaredReturnType->isVoid()->yes()
|| $declaredReturnType->isVoid()
->yes()
) {
return true;
}
Expand Down Expand Up @@ -183,7 +185,7 @@ private function isPropertyAssignSafe(Assign $assign): bool
}

$propertyReflection = $this->reflectionResolver->resolvePropertyReflectionFromPropertyFetch($assign->var);
if ($propertyReflection === null) {
if (! $propertyReflection instanceof PhpPropertyReflection) {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Rector\NodeTypeResolver\PHPStan\Scope;

use PHPStan\Analyser\Fiber\FiberScope;
use Error;
use PhpParser\Node;
use PhpParser\Node\Arg;
Expand Down Expand Up @@ -86,6 +85,7 @@
use PhpParser\Node\Stmt\While_;
use PhpParser\Node\UnionType;
use PhpParser\NodeTraverser;
use PHPStan\Analyser\Fiber\FiberScope;
use PHPStan\Analyser\MutatingScope;
use PHPStan\Analyser\NodeScopeResolver;
use PHPStan\Analyser\ScopeContext;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\ClassMethod\RemoveParentDelegatingConstructorRector;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
Expand Down