Problems with doctrine magic methods #10567
-
Hello:
I got 2 errors of magic methods in doctrine, but I have installed phpstan-doctrine as I have in the baseline errors of mapping like
The 2 errors are:
$plan = $this->manager->getRepository(Plan::class)->findOneByStripeId($planType); Mapping: /**
* @var string
*
* @ORM\Column(name="stripe_id", type="string", length=32)
*/
private $stripeId;
$em = $this->getDoctrine()->getManager();
$user = $em->getRepository(User::class)->findByUserHash($userHash); Mapping:
tried with object manager and without and none works:
the code of doctrine-orm-bootstrap.php <?php
use \Symfony\Component\Dotenv\Dotenv;
require __DIR__ . '/vendor/autoload.php';
(new Dotenv())->bootEnv(__DIR__ . '/.env');
$kernel = new AppKernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$kernel->boot();
return $kernel->getContainer()->get('doctrine')->getManager(); The error when running with the objectManagerLoader
I hope I give all need it data thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yeah, I'd expect this feature needs
|
Beta Was this translation helpful? Give feedback.
Yeah, I'd expect this feature needs
objectManagerLoader
to be set up.MailTrack\Track\Domain\TrackRepository
problem. This class should be autoloadable by the config you've written to composer.json. I'd say that if PHPStan crashes like that, your real app can crash with the same issue.