You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would be useful for the models to have null return types where needed as otherwise we need to add phpstan overrides in our code. An example being Google\Service\Calendar\Event->getOrganizer() which says it always returns an EventOrganizer when it can also return null.
Describe the solution you'd like
For the return to be marked as null e.g.
/**
* @return EventOrganizer|null
*/
public function getOrganizer()
{
return $this->organizer;
}
Activity
bshaffer commentedon Dec 29, 2022
Thanks for reporting this! I am open to the idea, but not looking forward to the 10,000+ lines of code this would change 😛
rodnaph commentedon Jan 13, 2023
This would be more than useful, it currently being incorrect can (and has) led to production bugs.
bendavies commentedon Jan 13, 2023
@bshaffer surely this is just (😉) an update to the generator in https://github.com/googleapis/google-api-php-client-services?
caveat: I haven't looked at the generator
bendavies commentedon Jan 13, 2023
the phpstan level could also be increased here, which will expose a lot of incorrect docblock issues.