-
Notifications
You must be signed in to change notification settings - Fork 105
Support Symfony Doctrine Bridge #27
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
Comments
It would not be enough to add a dynamic return type extension because
there’s currently no knowledge about User -> UserRepository. There’s a
proof of concept in #18 that needs some polishing.
Can you finish #18 and send a PR for this one? This might be a better fit
for phpstan-symfony though...
On Sat, 19 May 2018 at 00:59, Niels Keurentjes ***@***.***> wrote:
In Symfony's Doctrine bridge you 'must' inject Doctrine via the
Symfony\Bridge\Doctrine\RegistryInterface:
/** @var UserRepository */
private $userRepository;
public function __construct(RegistryInterface $registry)
{
$this->userRepository = $registry->getRepository(User::class);
}
This code fails however with:
Property xxx::$userRepository (xxx\UserRepository) does not accept
Doctrine\Common\Persistence\ObjectRepository.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#27>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AAGZuI1vKwGpziDiPA2Vum6-GxnhAxn7ks5tz1JSgaJpZM4UFdDf>
.
--
Ondřej Mirtes
|
Isn't this more or less exactly what #8 is doing, just via Symfony bridge? Seems all the code is already there. |
See the discussion in the linked issue to learn why I didn’t merge it. #18
is a viable successor but still needs work.
On Sat, 19 May 2018 at 11:40, Niels Keurentjes ***@***.***> wrote:
Isn't this more or less exactly what #8
<#8> is doing, just via
Symfony bridge? Seems all the code is already there.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#27 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGZuGuKbdldKoq6Ly4BPJx-4XWKtyNjks5tz-h5gaJpZM4UFdDf>
.
--
Ondřej Mirtes
|
See how the relevant dynamic return type extensions are now registered in extension.neon:
You can add another entry to your phpstan.neon with the right |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
In Symfony's Doctrine bridge you 'must' inject Doctrine via the
Symfony\Bridge\Doctrine\RegistryInterface
:This code fails however with:
The text was updated successfully, but these errors were encountered: