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

Use nullable return type for TypePart::getTypeNullable() #64

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bnf
Copy link

@bnf bnf commented Jun 6, 2019

…when setNullable has not been called explicitly.

Error was:

  PHP Fatal error:  Uncaught TypeError: Return value of
  gossi\codegen\model\PhpParameter::getNullable() must be
  of the type bool, null returned in
  […]/vendor/gossi/php-code-generator/src/model/parts/TypePart.php:75

Stack trace:
#0 […]/vendor/gossi/php-code-generator/src/generator/builder/parts/TypeBuilderPart.php(53): gossi\codegen\model\PhpParameter->getNullable()
#1 […]/vendor/gossi/php-code-generator/src/generator/builder/ParameterBuilder.php(16): gossi\codegen\generator\builder\ParameterBuilder->getType(Object(gossi\codegen\model\PhpParameter), true, true)
#2 […]/vendor/gossi/php-code-generator/src/generator/builder/AbstractBuilder.php(41): gossi\codegen\generator\builder\ParameterBuilder->build(Object(gossi\codegen\model\PhpParameter))
#3 […]/vendor/gossi/php-code-generator/src/generator/builder/parts/RoutineBuilderPart.php(40): gossi\codegen\generator\builder\AbstractBuilder->generate(Object(gossi\codegen\model\PhpParameter))
#4  in […]/vendor/gossi/php-code-generator/src/model/parts/TypePart.php on line 75

bnf added 2 commits July 3, 2019 11:00
…nition

…when generateNullableTypes is enabled
This is to prevent a fatal error when setNullable has not been called explicitly,
when generateNullableTypes is enabled.

Error was:
  PHP Fatal error:  Uncaught TypeError: Return value of
  gossi\codegen\model\PhpParameter::getNullable() must be
  of the type bool, null returned in
  […]/vendor/gossi/php-code-generator/src/model/parts/TypePart.php:75
@bnf bnf changed the title Add default value for TypePart::$typeNullable to prevent a fatal error Use nullable return type for TypePart::getTypeNullable() Jul 3, 2019
@bnf
Copy link
Author

bnf commented Jul 3, 2019

Hi, I forgot to add a test for the initial pull request. Sorry for that – I've just added one.
Hope you'll find some free time to review this one. Thank you in advance.

Looking forward to a 0.6 release containing this fix :)

bnf added a commit to qbus-agentur/openimmo that referenced this pull request Aug 23, 2019
…ator to fix api (re)generation

The recent nullable return type changes rely on a
(currently open) pull request for gossi/php-code-generator:
phpowermove/php-code-generator#64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant