container = new ContainerBuilder(); $loader = new YamlFileLoader($this->container, new FileLocator(DOSSIER_ROOT.'/app/conf')); $loader->load('services.yaml'); $formDiscovery = new FormDiscovery($this->container); $forms = $formDiscovery->discover(DOSSIER_ROOT.'/src/Form', '\Magdev\Dossier\Form'); $helperSet = $this->getHelperSet(); $helperSet->set(new FormHelper($forms)); $helperSet->set(new ExportHelper()); $helperSet->set(new OutputHelper($this->getName(), $this->getVersion())); $helperSet->set(new SectionManagerHelper($this->container->get('config'))); $this->container->get('analyzer') ->addAnalyzer(new ModelStatusAnalyzer()); } /** * Get the service-contianer * * @return \Symfony\Component\DependencyInjection\ContainerBuilder */ public function getContainer(): ContainerBuilder { return $this->container; } /** * Get a service by its name * * @param string $name * @param int $invalidBehavior * @return object|\Symfony\Component\DependencyInjection\Container|mixed|void|unknown */ public function getService(string $name, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) { return $this->getContainer()->get($name, $invalidBehavior); } /** * {@inheritDoc} * @see \Symfony\Component\Console\Application::getLongVersion() */ public function getLongVersion() { $code = ''.base64_decode(DOSSIER_LOGO).PHP_EOL; $header = $this->getService('translator')->trans('app.header'); if ('UNKNOWN' !== $this->getName()) { if ('UNKNOWN' !== $this->getVersion()) { $code .= ' '.$this->getName().' '.$this->getVersion().PHP_EOL; } else { $code .= ' '.$this->getName().PHP_EOL; } } $code .= ' '.$header.''; return $code; } }