File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
src/Symfony/Component/DependencyInjection Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,11 @@ public function __construct(ParameterBagInterface $parameterBag = null)
90
90
$ this ->parameterBag = $ parameterBag ?: new ParameterBag ();
91
91
}
92
92
93
+ public function __clone ()
94
+ {
95
+ throw new \LogicException ('Cloning the container is not supported. ' );
96
+ }
97
+
93
98
/**
94
99
* Compiles the container.
95
100
*
Original file line number Diff line number Diff line change @@ -662,6 +662,16 @@ public function testAlias()
662
662
$ this ->assertTrue ($ c ->has ('alias ' ));
663
663
$ this ->assertSame ($ c ->get ('alias ' ), $ c ->get ('bar ' ));
664
664
}
665
+
666
+ /**
667
+ * @expectedException LogicException
668
+ */
669
+ public function testThatCloningIsNotSupported ()
670
+ {
671
+ $ c = new Container ();
672
+
673
+ clone $ c ;
674
+ }
665
675
}
666
676
667
677
class ProjectServiceContainer extends Container
You can’t perform that action at this time.
0 commit comments