File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 99 ],
1010 "require" : {
1111 "php" : " ^7.4|^8.0" ,
12- "phpstan/phpstan" : " ^2.1.31 "
12+ "phpstan/phpstan" : " ^2.1.32 "
1313 },
1414 "autoload" : {
1515 "files" : [
Original file line number Diff line number Diff line change 2323 "nikic/php-parser" : " ^5.6.2" ,
2424 "ondram/ci-detector" : " ^4.2" ,
2525 "phpstan/phpdoc-parser" : " ^2.3" ,
26- "phpstan/phpstan" : " ^2.1.31 " ,
26+ "phpstan/phpstan" : " ^2.1.32 " ,
2727 "react/event-loop" : " ^1.5" ,
2828 "react/promise" : " ^3.3" ,
2929 "react/socket" : " ^1.16" ,
5555 "rector/swiss-knife" : " ^2.3" ,
5656 "rector/type-perfect" : " ^2.1" ,
5757 "shipmonk/composer-dependency-analyser" : " ^1.8" ,
58- "symplify/phpstan-extensions" : " ^12.0" ,
58+ "symplify/phpstan-extensions" : " ^12.0.2 " ,
5959 "symplify/phpstan-rules" : " ^14.8" ,
6060 "symplify/vendor-patches" : " ^11.5" ,
6161 "tomasvotruba/class-leak" : " ^2.0" ,
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