| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
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
*/
public function 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 callable(mixed) is right, there might be none or more arguments passed. |
Sorry, something went wrong.
|
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? |
Sorry, something went wrong.
|
Sorry, something went wrong.
|
Sorry, something went wrong.
| } | ||
|
|
||
| $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().
Sorry, something went wrong.
There was a problem hiding this comment.
You mean like this? I hope i got it correctly :)
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
No description provided.