googleapis / googleapis/google-api-php-client

Support for null returns

Open
#2,339 4 comments 0 reactions 0 assignees View on GitHub
type: feature request
Dominant language
PHP
Stars
9.8k
Forks
3.5k
PR merge metrics
No merged PRs in 30d

Description

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;
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.