File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77trait ContainerAwareTrait
88{
9- /** @var ContainerInterface */
9+ /** @var ContainerInterface|null */
1010 private $ container ;
1111
1212 /**
@@ -22,9 +22,9 @@ public function setContainer(ContainerInterface $container)
2222 }
2323
2424 /**
25- * @return ContainerInterface
25+ * @return ContainerInterface|null
2626 */
27- public function getContainer (): ContainerInterface
27+ public function getContainer (): ? ContainerInterface
2828 {
2929 return $ this ->container ;
3030 }
Original file line number Diff line number Diff line change @@ -17,4 +17,10 @@ public function testTraitGetsAndSetsContainer()
1717 $ trait ->setContainer ($ container );
1818 $ this ->assertSame ($ container , $ trait ->getContainer ());
1919 }
20- }
20+
21+ public function testTraitCanGetNullContainer ()
22+ {
23+ $ trait = $ this ->getMockForTrait (ContainerAwareTrait::class);
24+ $ this ->assertNull ($ trait ->getContainer ());
25+ }
26+ }
You can’t perform that action at this time.
0 commit comments