mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 02:53:50 +00:00
DX: use tags and dependency injection to build ExportManager
This commit is contained in:
@@ -18,7 +18,7 @@ use Symfony\Component\DependencyInjection\Definition;
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
|
||||
/**
|
||||
* Compiles the services tagged with :.
|
||||
* Compiles the services tagged with :
|
||||
*
|
||||
* - chill.export
|
||||
* - chill.export_formatter
|
||||
@@ -39,11 +39,11 @@ class ExportsCompilerPass implements CompilerPassInterface
|
||||
'Chill\MainBundle\Export\ExportManager'
|
||||
);
|
||||
|
||||
$this->compileExports($chillManagerDefinition, $container);
|
||||
$this->compileFilters($chillManagerDefinition, $container);
|
||||
$this->compileAggregators($chillManagerDefinition, $container);
|
||||
$this->compileFormatters($chillManagerDefinition, $container);
|
||||
$this->compileExportElementsProvider($chillManagerDefinition, $container);
|
||||
//$this->compileExports($chillManagerDefinition, $container);
|
||||
//$this->compileFilters($chillManagerDefinition, $container);
|
||||
//$this->compileAggregators($chillManagerDefinition, $container);
|
||||
//$this->compileFormatters($chillManagerDefinition, $container);
|
||||
//$this->compileExportElementsProvider($chillManagerDefinition, $container);
|
||||
}
|
||||
|
||||
private function compileAggregators(
|
||||
@@ -119,6 +119,12 @@ class ExportsCompilerPass implements CompilerPassInterface
|
||||
$knownAliases = [];
|
||||
|
||||
foreach ($taggedServices as $id => $tagAttributes) {
|
||||
|
||||
if (!$container->has($id)) {
|
||||
dump('the service was removed');
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($tagAttributes as $attributes) {
|
||||
if (!isset($attributes['alias'])) {
|
||||
throw new LogicException("the 'alias' attribute is missing in your " .
|
||||
|
Reference in New Issue
Block a user