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)
9090 $ this ->parameterBag = $ parameterBag ?: new ParameterBag ();
9191 }
9292
93+ public function __clone ()
94+ {
95+ throw new \LogicException ('Cloning the container is not supported ' );
96+ }
97+
9398 /**
9499 * Compiles the container.
95100 *
Original file line number Diff line number Diff line change @@ -662,6 +662,16 @@ public function testAlias()
662662 $ this ->assertTrue ($ c ->has ('alias ' ));
663663 $ this ->assertSame ($ c ->get ('alias ' ), $ c ->get ('bar ' ));
664664 }
665+
666+ /**
667+ * @expectedException LogicException
668+ */
669+ public function testThatCloningIsNotSupported ()
670+ {
671+ $ c = new Container ();
672+
673+ clone $ c ;
674+ }
665675}
666676
667677class ProjectServiceContainer extends Container
You can’t perform that action at this time.
0 commit comments