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

add compatibility with Symfony 7.0+ #96

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open

Conversation

barbuslex
Copy link

Theses modifications add Symfony 7.0+ compatibility

@rvanlaak
Copy link
Collaborator

rvanlaak commented Oct 3, 2024

Thank you for this PR! The version bump could be considered a BC break, can you try to keep compatibility with nyholm/symfony-bundle-test:^v2.0 and doctrine/annotations:^v1.7 ?

@rvanlaak
Copy link
Collaborator

rvanlaak commented Oct 3, 2024

Also, tests fail so you probably will need to include v7 with the symfony/twig-bundle under require-dev as well.

@barbuslex
Copy link
Author

Ok i will try but it seems it's symfony dependencies which are in conflict themselves

@barbuslex
Copy link
Author

barbuslex commented Oct 15, 2024

@rvanlaak I have check.

The problem is due to nyholm/symfony-bundle-test
The bundle has abandoned support of the Symfony 4.4 version in this nyholm/symfony-bundle-test version 3.0. (serious breaking changes)

image

Maybe it's preferable to remove support of 4.4 version too in futher version of APYBreadcrumbTrailBundle (ex: 2.0.0) otherwise the upgrade to Symfony 7 will be impossible.

@barbuslex
Copy link
Author

I have try to set two vesions of the bundle in composer.json no problems in my repo tests. 🤞

@barbuslex
Copy link
Author

I have fix all errors from actions. Could you approve again @rvanlaak ?

Copy link
Collaborator

@rvanlaak rvanlaak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, let's try to get it shipped. Have some comments and questions regarding the changes. Is this the real minimum needed to add 7.x support?

@@ -20,12 +20,12 @@ class Breadcrumb
/**
* @var string Title of the breadcrumb
*/
private $title = null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the removals of null a result of the nullable_type_declaration_for_default_null_value PHP CS Fixer change? Not having them set to null could after construction potentially lead to exceptions on read when not being instantiated.

@@ -16,7 +16,7 @@
class Configuration implements ConfigurationInterface
{
#[\ReturnTypeWillChange]
public function getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilder
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the return type change because of dropping TwigBundle v3.4?

@@ -19,5 +19,12 @@
<tag name="kernel.event_listener" event="kernel.controller" method="onKernelController" priority="-1" />
</service>
<service id="apy_breadcrumb_trail.annotation.listener" alias="APY\BreadcrumbTrailBundle\EventListener\BreadcrumbListener" public="true" />

<service id="Doctrine\Common\Annotations\AnnotationReader" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doctrine annotations is optional (part of require-dev), so can not be mentioned as service for this bundle, as that will lead to exceptions on non-dev / prod runtime.

Also, as autowiring on this bundle is enabled by default, there should not be a need to define this service from another dependency.

<service id="Doctrine\Common\Annotations\AnnotationReader" />

<service id="APY\BreadcrumbTrailBundle\EventListener\BreadcrumbListener">
<argument type="service" id="Doctrine\Common\Annotations\AnnotationReader" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try getting this done with the autowiring that is enabled on this bundle?

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

Successfully merging this pull request may close these issues.

2 participants