We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ac198c commit f4ee4c4Copy full SHA for f4ee4c4
1 file changed
rules/NetteToSymfony/NodeAnalyzer/NetteControlFactoryInterfaceAnalyzer.php
@@ -8,6 +8,7 @@
8
use PHPStan\Type\ObjectType;
9
use PHPStan\Type\TypeWithClassName;
10
use PHPStan\Type\UnionType;
11
+use Rector\StaticTypeMapper\ValueObject\Type\ShortenedObjectType;
12
use Rector\TypeDeclaration\TypeInferer\ReturnTypeInferer;
13
14
final class NetteControlFactoryInterfaceAnalyzer
@@ -38,7 +39,13 @@ public function isComponentFactoryInterface(Interface_ $interface): bool
38
39
new ObjectType('Nette\Application\UI\Form'),
40
]);
41
- return $controlOrForm->isSuperTypeOf($returnType)->yes();
42
+ if ($returnType instanceof ShortenedObjectType) {
43
+ $returnType = new ObjectType($returnType->getFullyQualifiedName());
44
+ }
45
+
46
+ if ($controlOrForm->isSuperTypeOf($returnType)->yes()) {
47
+ return true;
48
49
}
50
51
return false;
0 commit comments