debug = $debug; $this->configurator = $configurator; } /** * @return Container */ public function getContainer() { $dumpClass = '\\' . $this->configurator->getDumpNamespace() . '\\' . $this->configurator->getDumpClassname(); if (!$this->debug && class_exists($dumpClass)) { $container = new $dumpClass(); } else { $container = $this->getConfiguredContainer(); $container->compile(); } return $container; } public function getConfiguredContainer() { return $this->configurator->configure(new ContainerBuilder()); } }