Skip to content

Commit 846c141

Browse files
committed
minor symfony#58520 [Contracts] add missing properties (xabbuh)
This PR was merged into the 7.1 branch. Discussion ---------- [Contracts] add missing properties | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT Since symfony#54496 the property is no longer part of the `ServiceSubscriberTrait` triggering a PHP deprecation like: > Creation of dynamic property Symfony\Contracts\Tests\Service\LegacyTestService::$container is deprecated Commits ------- fbfeefe add missing properties
2 parents b6a9fe3 + fbfeefe commit 846c141

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/Symfony/Contracts/Tests/Service/LegacyTestService.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class LegacyTestService extends LegacyParentTestService implements ServiceSubscr
3333
{
3434
use ServiceSubscriberTrait;
3535

36+
protected $container;
37+
3638
#[SubscribedService]
3739
public function aService(): Service2
3840
{

src/Symfony/Contracts/Tests/Service/ServiceSubscriberTraitTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ public function testParentNotCalledIfHasMagicCall()
5656
};
5757
$service = new class() extends ParentWithMagicCall {
5858
use ServiceSubscriberTrait;
59+
60+
private $container;
5961
};
6062

6163
$this->assertNull($service->setContainer($container));
@@ -69,6 +71,8 @@ public function testParentNotCalledIfNoParent()
6971
};
7072
$service = new class() {
7173
use ServiceSubscriberTrait;
74+
75+
private $container;
7276
};
7377

7478
$this->assertNull($service->setContainer($container));

0 commit comments

Comments
 (0)