Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for null returns #2339

Open
jdelaune opened this issue Nov 24, 2022 · 4 comments
Open

Support for null returns #2339

jdelaune opened this issue Nov 24, 2022 · 4 comments
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@jdelaune
Copy link

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;
  }
@bshaffer bshaffer added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Dec 29, 2022
@bshaffer
Copy link
Contributor

bshaffer commented 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
Copy link

rodnaph commented Jan 13, 2023

This would be more than useful, it currently being incorrect can (and has) led to production bugs.

@bendavies
Copy link

@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
Copy link

the phpstan level could also be increased here, which will expose a lot of incorrect docblock issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

4 participants