fix: offsetget is an alias for make

This commit is contained in:
Feek 2020-12-06 16:00:03 -05:00
parent 4651588756
commit 09b500ee87

View File

@ -100,7 +100,12 @@ class AppInterfaceProvider implements
string $called_fq_classlike_name = null,
string $called_method_name_lowercase = null
) : ?Type\Union {
if ($method_name_lowercase === 'offsetget' || $method_name_lowercase === 'offsetset') {
if ($method_name_lowercase === 'offsetget') {
// offsetget is an alias for make
return ContainerResolver::resolvePsalmTypeFromApplicationContainerViaArgs($source->getNodeTypeProvider(), $call_args);
}
if ($method_name_lowercase === 'offsetset') {
return $source->getCodebase()->getMethodReturnType(
get_class(ApplicationHelper::getApp()) . '::' . $method_name_lowercase,
$fq_classlike_name