Skip to content
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

Declaration of EventDispatcher:dispatch not compatible with Symfony 5 #32

Open
lcharette opened this issue Feb 12, 2022 · 3 comments
Open
Assignees

Comments

@lcharette
Copy link
Contributor

lcharette commented Feb 12, 2022

Latest version release add Symfony 5 in composer.json :
1.6.0...1.6.1#diff-d2ab9925cad7eac58e0ff4cc0d251a937ecf49e4b6bf57f8b95aab76648a9d34R13

First, this a breaking change as it can cause unwanted dependencies change in some cases, and should have done in a new major version.

That being said, EventDispatcher doesn’t seams to be compatible with latest Symfony version :

PHP Fatal error:  Declaration of RocketTheme\Toolbox\Event\EventDispatcher::dispatch($eventName, ?Symfony\Component\EventDispatcher\Event $event = null) must be compatible with Symfony\Component\EventDispatcher\EventDispatcher::dispatch(obj
ect $event, ?string $eventName = null): object in <SNIP>\UserFrosting-4.6.3\app\vendor\rockettheme\toolbox\Event\src\EventDispatcher.php on line 23

Fatal error: Declaration of RocketTheme\Toolbox\Event\EventDispatcher::dispatch($eventName, ?Symfony\Component\EventDispatcher\Event $event = null) must be compatible with Symfony\Component\EventDispatcher\EventDispatcher::dispatch(object $
event, ?string $eventName = null): object in <SNIP>\UserFrosting-4.6.3\app\vendor\rockettheme\toolbox\Event\src\EventDispatcher.php on line 23

(Ref: userfrosting/UserFrosting#1195)

@mahagr mahagr self-assigned this Feb 12, 2022
@mahagr mahagr added the bug label Feb 12, 2022
@mahagr
Copy link
Contributor

mahagr commented Feb 12, 2022

You're right, I should have updated only YAML.

That said, you should stop using Event Dispatcher in Toolbox as I have already removed it for the upcoming 2.0 release.

@mahagr mahagr added the fixed label Feb 12, 2022
@lcharette
Copy link
Contributor Author

Good to know. I already removed it in my next major version.

@mahagr
Copy link
Contributor

mahagr commented Feb 14, 2022

You can test by playing with the dev version (more testing cannot hurt):

composer.json:

{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/rockettheme/toolbox"
        }
    ]
}

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

2 participants