Skip to content

generated factories: fix return type - #152

Merged
dg merged 1 commit into
nette:masterfrom
matej21:fix/return-type-covariance
Apr 12, 2017
Merged

generated factories: fix return type#152
dg merged 1 commit into
nette:masterfrom
matej21:fix/return-type-covariance

Conversation

@matej21

@matej21 matej21 commented Apr 11, 2017

Copy link
Copy Markdown
Contributor
  • bug fix? yes
  • new feature? no
  • BC break? no

because php does not support return type covariance

@matej21
matej21 force-pushed the fix/return-type-covariance branch 2 times, most recently from 37c02a0 to bd30fea Compare April 11, 2017 14:10
Comment thread src/DI/PhpGenerator.php Outdated
->setParameters($this->convertParameters($def->parameters))
->setBody(str_replace('$this', '$this->container', $code))
->setReturnType($def->getClass());
->setReturnType(Reflection::getReturnType($rm)?: $def->getClass());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space before ?:

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

dg commented Apr 12, 2017

Copy link
Copy Markdown
Member

Thanks!

@dg
dg merged commit 3e65fd5 into nette:master Apr 12, 2017
dg pushed 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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants