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

self-reference in constructor #240

Closed
MartkCz opened this issue May 13, 2020 · 0 comments
Closed

self-reference in constructor #240

MartkCz opened this issue May 13, 2020 · 0 comments

Comments

@MartkCz
Copy link
Contributor

MartkCz commented May 13, 2020

Version: dev-master

$builder->addDefinition($this->prefix('linkGenerator'))
	->setType(LinkGeneratorInterface::class)
	->setFactory(LinkGenerator::class);
final class LinkGenerator implements LinkGeneratorInterface
{

	public function __construct(LinkGeneratorInterface $decorated)

generated service:

public function createServiceLinkGenerator(): LinkGeneratorInterface
{
	return new LinkGenerator($service, $this->getService('http.request'));
}

Yes, I forgot pass service id to definition, but imho it's bug, because variable $service is undefined.

@dg dg closed this as completed in 84d996b May 14, 2020
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

No branches or pull requests

1 participant