diff --git a/DependencyInjection/Compiler/MappingPredefinitionPass.php b/DependencyInjection/Compiler/MappingPredefinitionPass.php deleted file mode 100644 index c8af146..0000000 --- a/DependencyInjection/Compiler/MappingPredefinitionPass.php +++ /dev/null @@ -1,32 +0,0 @@ - - * @license https://github.com/opportus/ObjectMapperBundle/blob/master/LICENSE MIT - */ -final class MappingPredefinitionPass implements CompilerPassInterface -{ - /** - * {@inheritdoc} - */ - public function process(ContainerBuilder $container) - { - $filters = []; - - foreach ($container->findTaggedServiceIds('object_mapper.filter') as $filterId => $filterTags) { - $filters[] = new Reference($filterId); - } - - $container->getDefinition('opportus_object_mapper.map_builder')->setArgument(1, []); - $container->getDefinition('opportus_object_mapper.map_builder')->setArgument(2, $filters); - } -} diff --git a/DependencyInjection/MapBuilderFactory.php b/DependencyInjection/MapBuilderFactory.php deleted file mode 100644 index 21204db..0000000 --- a/DependencyInjection/MapBuilderFactory.php +++ /dev/null @@ -1,34 +0,0 @@ - - * @license https://github.com/opportus/ObjectMapperBundle/blob/master/LICENSE MIT - */ -final class MapBuilderFactory -{ - /** - * Creates a map builder. - * - * @param RouteBuilderInterface $routeBuilder - * @param Route[] $routes - * @param FilterInterface[] $routes - * @return MapBuilderInterface[] - */ - public function createMapBuilder(RouteBuilderInterface $routeBuilder, array $routes, array $filters): MapBuilderInterface - { - return new MapBuilder($routeBuilder, new RouteCollection($routes), new FilterCollection($filters)); - } -} diff --git a/DependencyInjection/OpportusObjectMapperExtension.php b/DependencyInjection/OpportusObjectMapperExtension.php index a8b84d6..103d9dd 100644 --- a/DependencyInjection/OpportusObjectMapperExtension.php +++ b/DependencyInjection/OpportusObjectMapperExtension.php @@ -2,11 +2,11 @@ namespace Opportus\ObjectMapperBundle\DependencyInjection; -use Opportus\ObjectMapper\Map\Filter\FilterInterface; -use Opportus\ObjectMapper\Map\MapBuilderInterface; -use Opportus\ObjectMapper\Map\Route\Point\PointFactoryInterface; -use Opportus\ObjectMapper\Map\Route\RouteBuilderInterface; use Opportus\ObjectMapper\ObjectMapperInterface; +use Opportus\ObjectMapper\Map\MapBuilderInterface; +use Opportus\ObjectMapper\Point\CheckPointInterface; +use Opportus\ObjectMapper\Point\PointFactoryInterface; +use Opportus\ObjectMapper\Route\RouteBuilderInterface; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; @@ -38,6 +38,7 @@ public function load(array $configs, ContainerBuilder $container) $container->setAlias(MapBuilderInterface::class, 'opportus_object_mapper.map_builder'); $container->setAlias(ObjectMapperInterface::class, 'opportus_object_mapper.object_mapper'); - $container->registerForAutoconfiguration(FilterInterface::class)->addTag('object_mapper.filter'); + $container->registerForAutoconfiguration(PathFinderInterface::class)->addTag('opportus_object_mapper.path_finder'); + $container->registerForAutoconfiguration(CheckPointInterface::class)->addTag('opportus_object_mapper.check_point'); } } diff --git a/OpportusObjectMapperBundle.php b/OpportusObjectMapperBundle.php index 5024e40..c93ac1d 100644 --- a/OpportusObjectMapperBundle.php +++ b/OpportusObjectMapperBundle.php @@ -2,8 +2,6 @@ namespace Opportus\ObjectMapperBundle; -use Opportus\ObjectMapperBundle\DependencyInjection\Compiler\MappingPredefinitionPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Bundle\Bundle; /** @@ -15,11 +13,4 @@ */ final class OpportusObjectMapperBundle extends Bundle { - /** - * {@inheritdoc} - */ - public function build(ContainerBuilder $container) - { - $container->addCompilerPass(new MappingPredefinitionPass()); - } } diff --git a/Resources/config/services.xml b/Resources/config/services.xml index 6fca0fc..5c5bb7a 100644 --- a/Resources/config/services.xml +++ b/Resources/config/services.xml @@ -6,25 +6,20 @@ - + - + - - - - - diff --git a/composer.json b/composer.json index 5bc6e66..57004a0 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ ], "require": { "php": "^7.1.0", - "opportus/object-mapper": "v1.0.0-alpha.10", + "opportus/object-mapper": "v1.0.0-beta.6", "symfony/http-kernel": "^4.0", "symfony/dependency-injection": "^4.0", "symfony/config": "^4.0"