Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fe1759a

Browse files
minor #46496 [FrameworkBundle] update docblock to not expose the internal class (xabbuh)
This PR was merged into the 6.1 branch. Discussion ---------- [FrameworkBundle] update docblock to not expose the internal class | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #46483 | License | MIT | Doc PR | The change was introduced in #44695 motivated by the idea to be able to use the `getServiceIds()` and `getRemovedIds()` methods which are Symfony-specific methods. Exposing the `TestContainer` has the drawback of static analysis tools complaining about making use of internal classes. Since the interesting methods are part of the base `Container` class which is not internal I propose to change the docblock to return an instance of this class instead. Commits ------- f30db82 update docblock to not expose the internal class
2 parents df08c26 + f30db82 commit fe1759a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.github/expected-missing-return-types.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ index d68ae4c8b3..8e980a9e70 100644
1414
* @return TestContainer
1515
*/
1616
- protected static function getContainer(): ContainerInterface
17-
+ protected static function getContainer(): TestContainer
17+
+ protected static function getContainer(): Container
1818
{
1919
if (!static::$booted) {
2020
diff --git a/src/Symfony/Component/BrowserKit/AbstractBrowser.php b/src/Symfony/Component/BrowserKit/AbstractBrowser.php

src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Bundle\FrameworkBundle\Test;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Component\DependencyInjection\Container;
1516
use Symfony\Component\DependencyInjection\ContainerInterface;
1617
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
1718
use Symfony\Component\HttpKernel\KernelInterface;
@@ -83,7 +84,7 @@ protected static function bootKernel(array $options = []): KernelInterface
8384
*
8485
* Using this method is the best way to get a container from your test code.
8586
*
86-
* @return TestContainer
87+
* @return Container
8788
*/
8889
protected static function getContainer(): ContainerInterface
8990
{

0 commit comments

Comments
 (0)