Giter Club home page Giter Club logo

tactician-domain-events-bundle's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

tactician-domain-events-bundle's Issues

Allow bundle to install in SF 4.0 ?

Is there any reason why we couldn't add SF 4.0 dependencies ?

"symfony/http-kernel": "^2.8|^3.0|^4.0",
"symfony/dependency-injection": "^2.8|^3.0|^4.0",

?

Service or alias has been removed or inlined when the container was compiled

Hi,

I'm using this bundle in a Symfony 4 app and am getting the following warning when clearing cache etc:

The "App\Application\EventListener\User\PasswordResetRequestedListener" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead.

My event listener is wired up in services.yaml as follows:

App\Application\EventListener\User\PasswordResetRequestedListener:
    class: App\Application\EventListener\User\PasswordResetRequestedListener
    tags:
        - { name: tactician.event_listener, event: App\Domain\Events\PasswordResetRequested }

My Tactician config is as follows:

tactician:
    commandbus:
        default:
            middleware:
                - tactician_domain_events.middleware.release_recorded_events
                - tactician.middleware.locking
                - tactician.middleware.doctrine
                - tactician.middleware.command_handler

tactician_domain_event:
    collect_from_all_managed_entities: true

I've done some searching and it seems to be related to Symfony 4 making services private by default. I don't want to override this for every event listener. Am I missing something in the config?

Thanks

Debug command makes using autowiring with EventSubscribers and EventListeners impossible

At the moment when PopulateDebugCommandPass is executed AutowiringPass haven't been executed yet (first one works on PassConfig::TYPE_BEFORE_OPTIMIZATION phase and later one works on PassConfig::TYPE_OPTIMIZE phase of container building).
So when using $subscriber = $container->get($serviceId); (PopulateDebugCommandPass.php:33) autowired services aren't ready to be fetched from container thus throwing next exception:
Too few arguments to function MyEventSubscriber::__construct(), 0 passed and exactly 3 expected .
I suggest using reflection here to be sure that non-prepared services are fetched by that moment.

domain event on removal not working with CollectsEventsFromAllEntitiesManagedByUnitOfWork

Hi,

First, thanks for the work on this bundle. I've been picking some ideas from ddd and this bundle has been very helpful !

So, I just wanted to issue a domain event after removing an entity and noticed it did not work if I had

tactician_domain_event:
    collect_from_all_managed_entities: true

Seems like the removed entity does not figure in the unit of work on the postFlush method.

On the other hand, after changing the collect_from_all_managed_entities configuration to true false (edit), the event was dispatched correctly.

activation of event subscriber make container compilation fail

Hello,

I've activated event subscribers by using this configuration

services:
    _defaults:
        autowire: true
        autoconfigure: true
        public: false

    _instanceof:
        AppBundle\EventListener\DomainEventSubscriberInterface:
            tags:
                - { name: tactician.event_subscriber }

While it worked in dev environment, I got this issue while running a cache:clear command in production

docker-compose run --rm php php bin/console cache:clear --env=prod -vvv                                                                                                                                                                                                                                             !10320

In ParameterBag.php line 102:
                                                                                
  [Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException]  
  You have requested a non-existent parameter "container.build_id".             
                                                                                

Exception trace:
 Symfony\Component\DependencyInjection\ParameterBag\ParameterBag->get() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/EnvPlaceholderParameterBag.php:57
 Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag->get() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:133
 Symfony\Component\DependencyInjection\Container->getParameter() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:1268
 Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:1221
 Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:1134
 Symfony\Component\DependencyInjection\ContainerBuilder->createService() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:623
 Symfony\Component\DependencyInjection\ContainerBuilder->doGet() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:1264
 Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:1221
 Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:1134
 Symfony\Component\DependencyInjection\ContainerBuilder->createService() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:623
 Symfony\Component\DependencyInjection\ContainerBuilder->doGet() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:1264
 Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:1221
 Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:1134
 Symfony\Component\DependencyInjection\ContainerBuilder->createService() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:623
 Symfony\Component\DependencyInjection\ContainerBuilder->doGet() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:1264
 Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:1221
 Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:1134
 Symfony\Component\DependencyInjection\ContainerBuilder->createService() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:623
 Symfony\Component\DependencyInjection\ContainerBuilder->doGet() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:1264
 Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:1221
 Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:1221
 Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:1134
 Symfony\Component\DependencyInjection\ContainerBuilder->createService() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:623
 Symfony\Component\DependencyInjection\ContainerBuilder->doGet() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:1264
 Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:1221
 Symfony\Component\DependencyInjection\ContainerBuilder->doResolveServices() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:1134
 Symfony\Component\DependencyInjection\ContainerBuilder->createService() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:623
 Symfony\Component\DependencyInjection\ContainerBuilder->doGet() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:588
 Symfony\Component\DependencyInjection\ContainerBuilder->get() at /var/www/vendor/bornfreee/tactician-domain-events-bundle/src/DependencyInjection/Compiler/PopulateDebugCommandPass.php:33
 BornFree\TacticianDomainEventBundle\DependencyInjection\Compiler\PopulateDebugCommandPass->process() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php:141
 Symfony\Component\DependencyInjection\Compiler\Compiler->compile() at /var/www/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:778
 Symfony\Component\DependencyInjection\ContainerBuilder->compile() at /var/www/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:643
 Symfony\Component\HttpKernel\Kernel->initializeContainer() at /var/www/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:137
 Symfony\Component\HttpKernel\Kernel->boot() at /var/www/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:64
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/www/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:148

Commenting out the tagging feature from the services.yml file avoided this error.

I could get rid of this error by removing the $serializer argument from this subscriber constructor

final class VotingBallotCreationSubscriber implements DomainEventSubscriberInterface
{
    private $producer;
    private $serializer;

    public function __construct(
        Serializer $serializer,
        Producer $producer
    ) {
        $this->serializer = $serializer;
        $this->producer = $producer;
    }

Any idea about how to solve that or how I can give more debug information if needed ?

Regards,
Mikael

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.