Closed
Description
Q | A |
---|---|
Bug report? | yes |
Feature request? | no |
BC Break report? | no |
RFC? | no |
Symfony version | 4.0.3 |
According to this code part:
symfony/src/Symfony/Bundle/FrameworkBundle/Client.php
Lines 42 to 50 in 332ad0a
The container may be null
if the kernel has been shutdown.
But this simply call $this->kernel->getContainer();
and according to the PHPDoc:
symfony/src/Symfony/Component/HttpKernel/KernelInterface.php
Lines 127 to 132 in 332ad0a
It should never return null
, always a ContainerInterface
.
This also make PHPStan yelling on web tests:
Calling method get() on possibly null value of type Symfony\Component\DependencyInjection\ContainerInterface|null.
If am I right, the PHPDoc of the Client
must be corrected.
If it may return null, I suggest to throw an exception instead. This method should not called if the kernel is not booted AFAIK.
What do you think?
Metadata
Metadata
Assignees
Labels
No labels