Skip to content

Commit

Permalink
add missing compiler registration
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehyiah committed Feb 29, 2024
1 parent df8c59a commit c885c5a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
http://symfony.com/schema/dic/services/services-1.0.xsd">

<services>
<service id="Ehyiah\MappingBundle\DependencyInjection\TransformerLocator" public="true" />
<service id="Ehyiah\MappingBundle\Service\TransformerLocator" public="true" />

<service id="Ehyiah\MappingBundle\MappingService" public="true">
<argument type="service" id="Doctrine\ORM\EntityManagerInterface"/>
<argument type="service" id="Ehyiah\MappingBundle\DependencyInjection\TransformerLocator"/>
<argument type="service" id="Ehyiah\MappingBundle\Service\TransformerLocator"/>
<argument type="service" id="monolog.logger.mapping"/>
</service>
</services>
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/Compiler/TransformerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Ehyiah\MappingBundle\DependencyInjection\Compiler;

use Ehyiah\MappingBundle\DependencyInjection\TransformerLocator;
use Ehyiah\MappingBundle\Service\TransformerLocator;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
Expand Down
6 changes: 6 additions & 0 deletions src/MappingBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

namespace Ehyiah\MappingBundle;

use Ehyiah\MappingBundle\DependencyInjection\Compiler\TransformerPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;

// More details on https://symfony.com/doc/current/bundles/configuration.html#using-the-abstractbundle-class
class MappingBundle extends Bundle
{
public function build(ContainerBuilder $container): void
{
$container->addCompilerPass(new TransformerPass());
}
}
2 changes: 1 addition & 1 deletion src/MappingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

use Doctrine\ORM\EntityManagerInterface;
use Ehyiah\MappingBundle\Attributes\MappingAware;
use Ehyiah\MappingBundle\DependencyInjection\TransformerLocator;
use Ehyiah\MappingBundle\Exceptions\MappingException;
use Ehyiah\MappingBundle\Exceptions\NotMappableObject;
use Ehyiah\MappingBundle\Service\TransformerLocator;
use Psr\Log\LoggerInterface;
use ReflectionClass;
use ReflectionException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Ehyiah\MappingBundle\DependencyInjection;
namespace Ehyiah\MappingBundle\Service;

use Ehyiah\MappingBundle\Exceptions\MultipleTransformerException;
use Ehyiah\MappingBundle\Exceptions\TransformerNotFoundException;
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/MappingServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
use DateTime;
use Doctrine\ORM\EntityManagerInterface;
use Ehyiah\MappingBundle\Attributes\MappingAware;
use Ehyiah\MappingBundle\DependencyInjection\TransformerLocator;
use Ehyiah\MappingBundle\Exceptions\NotMappableObject;
use Ehyiah\MappingBundle\MappingService;
use Ehyiah\MappingBundle\Service\TransformerLocator;
use Ehyiah\MappingBundle\Tests\Dummy\DummyMappedObject;
use Ehyiah\MappingBundle\Tests\Dummy\DummyMappedObjectWithoutAttribute;
use Ehyiah\MappingBundle\Tests\Dummy\DummyTargetObject;
Expand Down

0 comments on commit c885c5a

Please sign in to comment.