class Module
{
public function onBootstrap(MvcEvent $event): void
{
$config = $event->getApplication()->getServiceManager()->get('config');
// ....
}
}
This code hangs phpstan for about 5 minutes. Calling $event->getApplication()->getServiceManager()->get('AnyService') works without any issues. Currently I am using a workaround:
use Interop\Container\ContainerInterface;
class Module
{
public function onBootstrap(MvcEvent $event): void
{
/** @var ContainerInterface $serviceManager */
$serviceManager = $event->getApplication()->getServiceManager();
$config = $serviceManager->get('config');
// ....
}
}
Tested on:
PHP 8.0.15
PHPStan 1.4.10
PHPStan Laminas Framework 1.0.0
I have few modules which do someting like this:
This code hangs phpstan for about 5 minutes. Calling
$event->getApplication()->getServiceManager()->get('AnyService')
works without any issues. Currently I am using a workaround:Tested on: PHP 8.0.15 PHPStan 1.4.10 PHPStan Laminas Framework 1.0.0