@@ -235,9 +235,9 @@ protected function attributeInheritanceTree(\Reflector $subject, string $attribu
235235 *
236236 * This includes both classes and interfaces.
237237 *
238- * @param \ReflectionClass $subject
238+ * @param \ReflectionClass<object> $subject
239239 * The reflection of the class for which we want the ancestors.
240- * @return iterable<\ReflectionClass>
240+ * @return iterable<\ReflectionClass<object> >
241241 * @throws \ReflectionException
242242 */
243243 protected function classInheritanceTree (\ReflectionClass $ subject ): iterable
@@ -293,7 +293,7 @@ protected function parameterInheritanceTree(\ReflectionParameter $subject): iter
293293 *
294294 * @param \ReflectionProperty|\ReflectionMethod|\ReflectionClassConstant $subject
295295 * The reflection of the component for which we want the ancestors.
296- * @return iterable<\Reflector >
296+ * @return iterable<\ReflectionProperty|\ReflectionMethod|\ReflectionClassConstant >
297297 * @throws \ReflectionException
298298 */
299299 protected function classElementInheritanceTree (\ReflectionProperty |\ReflectionMethod |\ReflectionClassConstant $ subject ): iterable
@@ -309,6 +309,7 @@ protected function classElementInheritanceTree(\ReflectionProperty|\ReflectionMe
309309 foreach ($ this ->classAncestors ($ subject ->getDeclaringClass ()->name ) as $ class ) {
310310 $ rClass = new \ReflectionClass ($ class );
311311 if ($ rClass ->$ hasMethod ($ subjectName )) {
312+ // @phpstan-ignore generator.valueType (PHPStan thinks this could be false, but I'm pretty sure it's wrong.)
312313 yield $ rClass ->$ getMethod ($ subjectName );
313314 }
314315 }
@@ -323,7 +324,7 @@ protected function classElementInheritanceTree(\ReflectionProperty|\ReflectionMe
323324 public function classAncestors (string $ class , bool $ includeClass = true ): array
324325 {
325326 // These methods both return associative arrays, making + safe.
326- /** @var array<class-string> $ancestors */
327+ /** @var array<string, class-string> $ancestors */
327328 $ ancestors = class_parents ($ class ) + class_implements ($ class );
328329 return $ includeClass
329330 ? [$ class => $ class ] + $ ancestors
0 commit comments