File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020use PhpParser \Node \Stmt \Trait_ ;
2121use PHPStan \Reflection \ClassReflection ;
2222use PHPStan \Type \ObjectType ;
23+ use PHPStan \Type \StaticType ;
2324use PHPStan \Type \ThisType ;
2425use Rector \Enum \ObjectReference ;
2526use Rector \NodeNameResolver \NodeNameResolver ;
@@ -61,6 +62,13 @@ public function isLocalPropertyFetch(Node $node): bool
6162 ? $ this ->nodeTypeResolver ->getType ($ node ->class )
6263 : $ this ->nodeTypeResolver ->getType ($ node ->var );
6364
65+ // patch clone usage
66+ // @see https://github.com/phpstan/phpstan-src/commit/020adb548011c098cdb2e061019346b0a838c6a4
67+ // @see https://github.com/rectorphp/rector-src/pull/7622
68+ if ($ variableType instanceof StaticType && ! $ variableType instanceof ThisType) {
69+ $ variableType = $ variableType ->getStaticObjectType ();
70+ }
71+
6472 if ($ variableType instanceof ObjectType) {
6573 $ classReflection = $ this ->reflectionResolver ->resolveClassReflection ($ node );
6674 if ($ classReflection instanceof ClassReflection) {
You can’t perform that action at this time.
0 commit comments