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

CommandDataCollector #488

Closed
blixit opened this issue Oct 7, 2018 · 8 comments · Fixed by #489
Closed

CommandDataCollector #488

blixit opened this issue Oct 7, 2018 · 8 comments · Fixed by #489
Labels
Milestone

Comments

@blixit
Copy link
Contributor

blixit commented Oct 7, 2018

I'm trying to use the DoctrineMongoDBBundle with symfony4.
After the bundle installation,
composer require doctrine/mongodb-odm-bundle
I got this error:

Compile Error: Declaration of Doctrine\Bundle\MongoDBBundle\DataCollector\CommandDataCollector::collect(Symfony\Component\HttpFoundation\Request $request, Symfony\Component\HttpFoundation\Response $response, ?Throwable $exception = NULL)
must be compatible with Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface::collect(Symfony\Component\HttpFoundation\Request $request, Symfony\Component\HttpFoundation\Response $response, ?Exception $exception = NULL)

This error can be fixed by changing Throwable by Exception.

@malarzm
Copy link
Member

malarzm commented Oct 7, 2018

Indeed, the signature contains Exception for 6 years now, mind sending us a PR? :)

@malarzm malarzm added this to the 4.0.0 milestone Oct 7, 2018
@malarzm malarzm added the bug label Oct 7, 2018
@blixit
Copy link
Contributor Author

blixit commented Oct 8, 2018

Indeed, the signature contains Exception for 6 years now, mind sending us a PR? :)

Of course. let me fork the project.

I'm wondering how could I check that changing interface Throwable by class \Exception won't break any other part of the code ?

blixit added a commit to blixit/DoctrineMongoDBBundle that referenced this issue Oct 8, 2018
Changed exception interface 'Throwable' by the explicit class '\Exception' in order to fix doctrine#488
@alcaeus
Copy link
Member

alcaeus commented Oct 8, 2018

We need to check some more classes - #484 added doctrine/coding-standard which requires using Throwable instead of Exception.

@blixit
Copy link
Contributor Author

blixit commented Oct 8, 2018

We need to check some more classes - #484 added doctrine/coding-standard which requires using Throwable instead of Exception.

Yes, that's my point. please let me know if I should send the PR.

@alcaeus
Copy link
Member

alcaeus commented Oct 8, 2018

Yes please! 👍

@blixit
Copy link
Contributor Author

blixit commented Oct 8, 2018

ok it's done.
Here is the PR link #489

@jcaillot
Copy link

Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface interface changed (again) with the 5.0 version !

we have got :

Symfony 4.2

public function collect(Request $request, Response $response, \Exception $exception = null);
https://github.com/symfony/symfony/blob/4.2/src/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php

Symfony 4.3 and 4.4

public function collect(Request $request, Response $response/*, \Throwable $exception = null*/);

https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php

Symfony 5.0

public function collect(Request $request, Response $response, \Throwable $exception = null);

https://github.com/symfony/symfony/blob/5.0/src/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php

@alcaeus
Copy link
Member

alcaeus commented Nov 28, 2019

See #604 - 4.1.0 with a fix will be out shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants