Skip to content

Conversation

@eerison
Copy link
Contributor

@eerison eerison commented Dec 2, 2025

Add Suport symfony 8 and php 8.5

I am targeting this branch, because {reason}.

Related: #1837

Changelog

### Added
- Added support Symfony 8
- Added support php 8.5

### Removed
- Removed Support Symfony 7.2

To do

@eerison
Copy link
Contributor Author

eerison commented Dec 2, 2025

hmmm any idea which approach I could use in this case:

we are using : Symfony\Component\PropertyInfo\Type, But in Symfony 8 it was replaced to Symfony\Component\TypeInfo\Type.

@dmaicher any idea?

@dmaicher
Copy link
Contributor

dmaicher commented Dec 2, 2025

hmmm any idea which approach I could use in this case:

we are using : Symfony\Component\PropertyInfo\Type, But in Symfony 8 it was replaced to Symfony\Component\TypeInfo\Type.

@dmaicher any idea?

I guess we can just ignore those errors? PropertyTypeExtractorInterface::getTypes was also removed on Symfony 8 so it won't be called anyway.

@dmaicher dmaicher linked an issue Dec 2, 2025 that may be closed by this pull request
@eerison
Copy link
Contributor Author

eerison commented Dec 2, 2025

PropertyTypeExtractorInterface

now I get what you mean 😄 , getTypes is not used anymore. then yeah I guess we are safe to remove this method too.

should I add deprecation trigger, or just NEXT_MAJOR is fine?

@eerison eerison force-pushed the suport-symfony8 branch 5 times, most recently from 79e1192 to a8442ff Compare December 3, 2025 10:44
"sonata-project/form-extensions": "^1.20 || ^2.0",
"sonata-project/seo-bundle": "^3.4",
"sonata-project/twig-extensions": "^1.3 || ^2.0",
"symfony-cmf/routing-bundle": "^2.1 || ^3.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I strict on ^3.1.2 or keep it more flexible in ^3.0?

the problem detected was more related with symfony-cmf then page bundle.

Ignore errors from getTypes
path: src/Form/Type/PageSelectorType.php

-
rawMessage: Possibly invalid array key type string|null.
Copy link
Contributor Author

@eerison eerison Dec 3, 2025

Choose a reason for hiding this comment

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

I do not know if it could be related with phpstan/phpstan-symfony#322

like we are doing on https://github.com/sonata-project/SonataPageBundle/blob/4.x/phpstan-baseline.neon#L22

But I would prefer ignore those errors besides add workaround for code that never going to be used. like this getType as null.

we add checks to verify if it's null or not, But it is a field that should be filled, otherwise some places wont work, like phpstan says.

if this field is null, the code will break for sure.

My suggestion is, ignore those errors and create a issue to solve this mess, it will make our life easier.

and I remember it was painful for this PR: #1522

let me know what you think and I could open a issue.

@@ -1,24 +1,181 @@
parameters:
ignoreErrors:
- # Disallow VariableMethodCallRule and VariablePropertyFetchRule
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should I create another file to not mix with this one?

@eerison eerison force-pushed the suport-symfony8 branch 2 times, most recently from 50ba66b to 2825101 Compare December 3, 2025 12:39
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.

Add Symfony 8 compatibility

3 participants