Skip to content

Commit 1a3d2dd

Browse files
Evan Shawnicolas-grekas
authored andcommitted
[Contracts] Fix setting $container before calling parent::setContainer in ServiceSubscriberTrait
1 parent 35c6c28 commit 1a3d2dd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ServiceSubscriberTrait.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,13 @@ public static function getSubscribedServices(): array
9898
*/
9999
public function setContainer(ContainerInterface $container)
100100
{
101-
$this->container = $container;
102-
101+
$ret = null;
103102
if (method_exists(get_parent_class(self::class) ?: '', __FUNCTION__)) {
104-
return parent::setContainer($container);
103+
$ret = parent::setContainer($container);
105104
}
106105

107-
return null;
106+
$this->container = $container;
107+
108+
return $ret;
108109
}
109110
}

0 commit comments

Comments
 (0)