Uh oh!
There was an error while loading. Please reload this page.
Added Nette\Caching\Cache dynamic return type extensions - #49
Conversation
3434ecc to
e5b5c36Compareondrejmirtes
commented
Apr 27, 2020
Hi, I worry that some cases will not work well, for example: /** * @template TFallback * @param mixed $key * @param (callable(mixed): TFallback)|null $fallback * @return TFallback */publicfunction load($key, callable$fallback = null)If the fallback is not passed, we have an unresolved TFallback. And in some other cases I'm not sure that |
adaamz
commented
Apr 27, 2020
Can we somehow tell that if no fallback is passed it should return null? In source is this https://github.com/nette/caching/blob/be02f7e/src/Caching/Cache.php#L104, so the parameter should be only one? |
ondrejmirtes
commented
Apr 27, 2020
|
492fbf8 to
68dbcdaCompareadaamz
commented
Apr 27, 2020
|
Uh oh!
There was an error while loading. Please reload this page.
| } | ||
| $fallbackParameterType = $scope->getType($methodCall->args[$fallbackParameterIndex]->value); | ||
| if (!$fallbackParameterType instanceof ParametersAcceptor) { |
There was a problem hiding this comment.
Better ask about ->isCallable()->yes(), get ->getCallableParametersAcceptors() and pass it to ParametersAcceptorSelector::selectFromArgs().
There was a problem hiding this comment.
You mean like this? I hope i got it correctly :)
Uh oh!
There was an error while loading. Please reload this page.
No description provided.