/** * @param string $name */ protected function getMethodType($name, FQCN $type, Index $index) { $class = $index->findClassByFQCN($type); if (empty($class)) { $class = $index->findInterfaceByFQCN($type); } if (empty($class)) { return null; } $method = $class->methods->get($name); if (empty($method)) { return null; } return $method->getReturn(); }