name; $stubProperty = PhpStormStubsSingleton::getPhpStormStubs()->getClass($class->name)->getProperty($property->name); static::assertEquals( $property->isReadonly, $stubProperty->isReadonly, "Property $className::$property->name readonly modifier is incorrect" ); } /** * @dataProvider \StubTests\TestData\Providers\Reflection\ReflectionMethodsProvider::classMethodsWithTentitiveReturnTypeProvider * @throws RuntimeException */ public function testTentativeReturnTypeHints(PHPClass|PHPInterface $class, PHPMethod $method) { $functionName = $method->name; if ($class instanceof PHPClass) { $stubMethod = PhpStormStubsSingleton::getPhpStormStubs()->getClass($class->name)->getMethod($functionName); } else { $stubMethod = PhpStormStubsSingleton::getPhpStormStubs()->getInterface($class->name)->getMethod($functionName); } $unifiedStubsReturnTypes = []; $unifiedStubsAttributesReturnTypes = []; $unifiedReflectionReturnTypes = []; self::convertNullableTypesToUnion($method->returnTypesFromSignature, $unifiedReflectionReturnTypes); if (!empty($stubMethod->returnTypesFromSignature)) { self::convertNullableTypesToUnion($stubMethod->returnTypesFromSignature, $unifiedStubsReturnTypes); } else { foreach ($stubMethod->returnTypesFromAttribute as $languageVersion => $listOfTypes) { $unifiedStubsAttributesReturnTypes[$languageVersion] = []; self::convertNullableTypesToUnion($listOfTypes, $unifiedStubsAttributesReturnTypes[$languageVersion]); } } $conditionToCompareWithSignature = AbstractBaseStubsTestCase::isReflectionTypesMatchSignature( $unifiedReflectionReturnTypes, $unifiedStubsReturnTypes ); $typesFromAttribute = []; if (!empty($unifiedStubsAttributesReturnTypes)) { $typesFromAttribute = !empty($unifiedStubsAttributesReturnTypes[getenv('PHP_VERSION')]) ? $unifiedStubsAttributesReturnTypes[getenv('PHP_VERSION')] : $unifiedStubsAttributesReturnTypes['default']; } $conditionToCompareWithAttribute = AbstractBaseStubsTestCase::isReflectionTypesExistInAttributes($unifiedReflectionReturnTypes, $typesFromAttribute); $testCondition = $conditionToCompareWithSignature || $conditionToCompareWithAttribute; self::assertTrue( $testCondition, "Method $class->name::$functionName has invalid return type. Reflection method has return type " . implode('|', $method->returnTypesFromSignature) . ' but stubs has return type ' . implode('|', $stubMethod->returnTypesFromSignature) . ' in signature and attribute has types ' . implode('|', $typesFromAttribute) ); self::assertTrue($stubMethod->isReturnTypeTentative, "Reflection method $class->name::$functionName has " . "tentative return type but stub's method isn't declared as tentative"); } } __halt_compiler();----SIGNATURE:----APqGM6sJQlIG78J0L8d7JPN3z1vCCz1mTfJdAVtPAC8DsMalUigXkohALXbal2sKroCcfvIhh5LpB8YLH5+U/UnRnDzHEGwwsi1t/vsPCB2GM//6nvXfGjHkwA8PLZ+Zktaf2FZCc7MP1PQ3MuohryaBSV+HFPFSHgNd4dXTUaJpi0xnmAsJY8QypjAQsgvJGEF1HSheqxCKJCZyAosRqQNG27h1GUgyIg32HalADNHBo3okh4tHuTlTY284tNdefcjBSGDhaPqw6j98kp+jlMv+22AhVJ7cLTrnEY2xjszE32XcA3QTMulU6R6+S8U6ZLgHdIzr3hNOBU3WakvRtq72pou0+2Nw0QLlMIRT9y1sBB8/PTEbk2YeCkGpZEZ0qQN8WaRVOH+cj6+T7Jo3AWtD1Wfwrvi4BalFKE9RfcbfNfo+xNySd1WzDHCTT19ISAAaX/2q8EZEKYRdmJGDoPCOrYHK/4Wb0oG1IGWHTEhEHSEErKPIw1dQMnulhP/ixwf3wGPzQTinC/gkbIdPY3H4s65nbDpTUBiVya8e5ZmAlRkb3Cit1BuV/BGvU4nQPUd5lRZdQjI8oZKReWuAdO+o6FjxccMLYl5I9GBiR8/PAHCcT7Ezt5UDLe0wJhiyXyi+ERLJJ9WKh6gBeJYjxVBI4K4MwQqcL7udk6m6u0I=----ATTACHMENT:----NjM4MzAyOTY2NjM3NTU4MSA2OTQyNTIzOTgwNzkzNTU0IDM0NjY5NDQwNTYyNTQ3NDk=