8000 [Workflow] Missing dependency on symfony/event-dispatcher · Issue #32330 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Workflow] Missing dependency on symfony/event-dispatcher #32330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sunkan opened this issue Jul 3, 2019 · 0 comments
Closed

[Workflow] Missing dependency on symfony/event-dispatcher #32330

sunkan opened this issue Jul 3, 2019 · 0 comments

Comments

@sunkan
Copy link
sunkan commented Jul 3, 2019

Symfony version(s) affected: >=4.3.0

Description
When using workflow as standalone component it will not work when in production due to missing dependency on symfony/event-dispatcher

How to reproduce

composer.json

{
    "require": {
        "symfony/workflow": "4.3"
    }
}

test.php

use Symfony\Component\Workflow\Definition;
use Symfony\Component\Workflow\Workflow;

include 'vendor/autoload.php';

$workflow = new Workflow(new Definition(['a'], []));

Run composer without dev dependencies
composer install --no-dev

Running test.php will result in

PHP Fatal error:  Uncaught Error: Class 'Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy' not found in ...

Possible Solution

Either do a null check before trying to call LegacyEventDispatcherProxy::decorate or add symfony/event-dispatcher as a required dependency.

lyrixx added a commit that referenced this issue Jul 3, 2019
…ed (xabbuh)

This PR was merged into the 4.3 branch.

Discussion
----------

[Workflow] only decorate when an event dispatcher was passed

| Q             | A
| ------------- | -
5BB4
--
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32330
| License       | MIT
| Doc PR        |

Commits
-------

f19f28a only decorate when an event dispatcher was passed
@lyrixx lyrixx closed this as completed Jul 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0