> Le 25 oct. 2019 à 04:31, Ken Stanley <doh...@gmail.com> a écrit :
> 
> If the parameter is null able, I may need to add an if condition to look up
> a sane default value when the parameter comes through as null. It would be
> much more succinct (and less error prone) to be able to say something like
> 
> /**
> * @ParamConverter(name=“application”, ...)
> */
> public function myAction(Request $request, Application $application)
> {
>    $user = $application->getUser() !?? $this->getUser();
> 
>   // ... do something with user, without worrying about it being null.
> }
> 

Did you meant: 

    $user = ($application ?? $this)->getUser();

?

—Claude

Reply via email to