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

generated factories: fix return type #152

Merged
merged 1 commit into from Apr 12, 2017
Merged

Conversation

@matej21
Copy link
Contributor

matej21 commented Apr 11, 2017

  • bug fix? yes
  • new feature? no
  • BC break? no

because php does not support return type covariance

@matej21 matej21 force-pushed the matej21:fix/return-type-covariance branch 2 times, most recently from 37c02a0 to bd30fea Apr 11, 2017
$factoryClass->addMethod($def->getImplementMode())
->setParameters($this->convertParameters($def->parameters))
->setBody(str_replace('$this', '$this->container', $code))
->setReturnType($def->getClass());
->setReturnType(Reflection::getReturnType($rm)?: $def->getClass());

This comment has been minimized.

Copy link
@hrach

hrach Apr 11, 2017

Contributor

space before ?:

@matej21 matej21 force-pushed the matej21:fix/return-type-covariance branch from bd30fea to 116cebc Apr 11, 2017
@dg

This comment has been minimized.

Copy link
Member

dg commented Apr 12, 2017

Thanks!

@dg dg merged commit 3e65fd5 into nette:master Apr 12, 2017
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.004%) to 93.857%
Details
dg added a commit that referenced this pull request Apr 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.