Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Symfony 5 fixes #68

Closed
wants to merge 2 commits into from
Closed

Symfony 5 fixes #68

wants to merge 2 commits into from

Conversation

hanishsingla
Copy link

@hanishsingla hanishsingla commented Jan 2, 2020

Fixes #67

@hanishsingla
Copy link
Author

This is failed due to #64 ?

@migo315
Copy link
Contributor

migo315 commented Jan 9, 2020

No this fails because:
Declaration of Flagception\Bundle\FlagceptionBundle\Profiler\FeatureDataCollector::collect() must be compatible with Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface::collect(Symfony\Component\HttpFoundation\Request $request, Symfony\Component\HttpFoundation\Response $response, Exception $exception = NULL) in /home/travis/build/bestit/flagception-bundle/src/Profiler/FeatureDataCollector.php

This bundle currently support all symfony versions from 2.7 and above. And the DataCollectorInterface has changed in some versions. For example, in 3.1 it has "Exception" as type for the third argument (https://github.com/symfony/symfony/blob/3.1/src/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php). In 4.3 it hasn't any type (https://github.com/symfony/symfony/blob/4.3/src/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php). And in 5.0 it is throwable now.

But we cannot implement this interface with strict types for all versions. We have to implement it differently for each symfony version. Specially for 4 and 5.

@hanishsingla
Copy link
Author

So we can release a new branch (Major version) with the only support of Symfony 5 to keep up to date with new versions of Symfony?

@hermann8u
Copy link

Also, this PR is compatible only with Symfony >= 4.3 because the class Symfony\Component\HttpKernel\Event\ControllerEvent only exists since this version.

@hanishsingla
Copy link
Author

@hermann8u so it means this bundle can never support Symfony5?

@hermann8u
Copy link

Yes it can. But you have to find a workaround to support both event class.

Here is a commit I made on a PR when I had to struggle with the same issue. I hope it can help you to find a solution :

https://github.com/ro0NL/symfony-http-responder/pull/35/commits/679c0e6f38dc83767e79435f23abdb1c77f48bc1

@migo315
Copy link
Contributor

migo315 commented Jan 15, 2020

I‘am currently on vacations. I will support as soon as I am at home (next weekend)

@hermann8u
Copy link

hermann8u commented Jan 15, 2020

IMO, you should consider dropping support for symfony < 3.4 in a new major version and support Symfony 5 in it.

@see https://symfony.com/releases

@migo315
Copy link
Contributor

migo315 commented Jan 15, 2020

Yes, I think that’s the way we have to go.

@migo315
Copy link
Contributor

migo315 commented Jan 22, 2020

I will create a new branch for Symfony 5.0 and upwards today.

@NikoGrano
Copy link

@migo315 Could you check this. Its kinda blocking upgrade.

@migo315
Copy link
Contributor

migo315 commented Jan 30, 2020

The master Branch has full Symfony 5 support now. I've done all changes and skip support for Symfony 2+3+4. I've released this changes with bundle Version 4.0.0.

But I also created the branch "3.x", where we can maintain Symfony 2 + 3 + 4.

So, for Symfony 5 use Flagception Bundle 4.0. For Symfony prior 5 use Flagception Bundle 3.0

Let me know if you find any mistakes. My tests were all successful. :-)

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

Successfully merging this pull request may close these issues.

Flagception\Bundle\FlagceptionBundle\Profiler\FeatureDataCollector::collect declaration error in Symfony5
4 participants