Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix compatibility with phpdocumentor/reflection-docblock 6.x#62887

Closed
xabbuh wants to merge 1 commit into
symfony:7.3from
xabbuh:reflection-docblock-6
Closed

fix compatibility with phpdocumentor/reflection-docblock 6.x#62887
xabbuh wants to merge 1 commit into
symfony:7.3from
xabbuh:reflection-docblock-6

Conversation

@xabbuh
Copy link
Copy Markdown
Member

@xabbuh xabbuh commented Dec 29, 2025

Q A
Branch? 7.3
Bug fix? yes
New feature? no
Deprecations? no
Issues #63179
License MIT

@xabbuh xabbuh requested a review from dunglas as a code owner December 29, 2025 13:38
@carsonbot carsonbot added this to the 8.1 milestone Dec 29, 2025
@carsonbot carsonbot changed the title support phpdocumentor/reflection-docblock 6.x support phpdocumentor/reflection-docblock 6.x Dec 29, 2025
@xabbuh xabbuh force-pushed the reflection-docblock-6 branch 3 times, most recently from c519574 to 5e9a9c9 Compare December 29, 2025 14:07
}

if ($docType instanceof Collection) {
if ($docType instanceof Collection || $docType instanceof Generic) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Collection got replaced with Generic in phpDocumentor/TypeResolver#238

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Collection and generic are not compatible, generic can be any generic even when it's not a collection like. The previous versions had this same possible miss, but it was less common as the collection had the requirement of 2 values. Like collection<key, value>. If this didn't match it would return an invalid tag definition.

The problem is that this dated from before generics existed. Today a Generic can have any number of templated types.

To be closer to the actual collection you might want to check for the number of types in the generic. Which doesn't necessarily mean it's a collection, but that's probably a problem that existed in earlier versions.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@symfony/mergers How do we want to deal with this? I don't even have an idea how to represent generics with the old Type class from the PropertyInfo component.

Copy link
Copy Markdown
Member

@nicolas-grekas nicolas-grekas Jan 12, 2026

Choose a reason for hiding this comment

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

what about saying we don't support v6 on branch 6.4 then? we can add a conflict rule. I know composer might install older tags which still will be incompatible... maybe release a 6.4.x that throws when v6 is installed, and in the following 6.4.x+1 we add the conflict?

then we add support on 7.3 with typeinfo

Comment thread src/Symfony/Component/PropertyInfo/Util/PhpDocTypeHelper.php Outdated
Comment thread src/Symfony/Component/PropertyInfo/Util/PhpDocTypeHelper.php Outdated
Copy link
Copy Markdown
Contributor

@jaapio jaapio left a comment

Choose a reason for hiding this comment

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

Added a few comments on the changes

Comment thread src/Symfony/Component/PropertyInfo/Util/PhpDocTypeHelper.php Outdated
@derrabus
Copy link
Copy Markdown
Member

Don't we usually treat compatibility fixes as bugfixes?

@xabbuh
Copy link
Copy Markdown
Member Author

xabbuh commented Dec 29, 2025

Don't we usually treat compatibility fixes as bugfixes?

We are not fully consistent about this. For Doctrine packages I think that’s true, but for other packages that can be different (see how we support amphp in the HttpClient component).

@nicolas-grekas
Copy link
Copy Markdown
Member

nicolas-grekas commented Dec 30, 2025

Don't we usually treat compatibility fixes as bugfixes?

What @xabbuh wrote. We might consider backporting later on, but we'd need reasons, so let's wait for community feedback if not being able to bump eg blocks supporting running older apps on newer PHP versions.

@derrabus
Copy link
Copy Markdown
Member

My main concern is that we only have conflict rules for the lower boundary:

"phpdocumentor/reflection-docblock": "<5.2",

So Composer would allow the installation of phpdocumentor/reflection-docblock v6 on a Symfony 6.4 project and the only feedback those projects would get is an exception at runtime, I would assume.

@nicolas-grekas nicolas-grekas modified the milestones: 8.1, 6.4 Jan 5, 2026
@nicolas-grekas nicolas-grekas added Bug and removed Feature labels Jan 5, 2026
@nicolas-grekas
Copy link
Copy Markdown
Member

nicolas-grekas commented Jan 5, 2026

Let's go for 6.4 you're right @derrabus !

see #62887 (comment)

@xabbuh xabbuh force-pushed the reflection-docblock-6 branch from 5e9a9c9 to c97b857 Compare January 5, 2026 10:54
@xabbuh xabbuh changed the base branch from 8.1 to 6.4 January 5, 2026 10:54
@xabbuh xabbuh changed the title support phpdocumentor/reflection-docblock 6.x fix compatibility with phpdocumentor/reflection-docblock 6.x Jan 5, 2026
@xabbuh xabbuh changed the title fix compatibility with phpdocumentor/reflection-docblock 6.x [PropertyInfo] fix compatibility with phpdocumentor/reflection-docblock 6.x Jan 5, 2026
Copy link
Copy Markdown
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

Let's target branch 7.3. See #63126 for 6.4

@carsonbot carsonbot changed the title [PropertyInfo] fix compatibility with phpdocumentor/reflection-docblock 6.x fix compatibility with phpdocumentor/reflection-docblock 6.x Jan 19, 2026
nicolas-grekas added a commit that referenced this pull request Jan 20, 2026
…k v6 is in use (branch 6.4 only) (nicolas-grekas)

This PR was merged into the 6.4 branch.

Discussion
----------

[PropertyInfo] Throw when phpdocumentor/reflection-docblock v6 is in use (branch 6.4 only)

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

Following the plan described in #62887 (comment)

Commits
-------

4f61769 [PropertyInfo] Throw when phpdocumentor/reflection-docblock v6 is in use (branch 6.4 only)
@nicolas-grekas
Copy link
Copy Markdown
Member

Ready for a rebase on 7.3

nicolas-grekas added a commit that referenced this pull request Jan 23, 2026
This PR was merged into the 6.4 branch.

Discussion
----------

[PropertyInfo] do not parse `scalar` as an object

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | see #62887 (comment), related to #45720
| License       | MIT

Commits
-------

821eeff do not parse "scalar" as an object
symfony-splitter pushed a commit to symfony/property-info that referenced this pull request Jan 23, 2026
This PR was merged into the 6.4 branch.

Discussion
----------

[PropertyInfo] do not parse `scalar` as an object

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | see symfony/symfony#62887 (comment), related to #45720
| License       | MIT

Commits
-------

821eeff1e05 do not parse "scalar" as an object
@nicolas-grekas nicolas-grekas changed the base branch from 6.4 to 7.3 January 26, 2026 13:52
@nicolas-grekas nicolas-grekas force-pushed the reflection-docblock-6 branch 2 times, most recently from d156a90 to a455c2f Compare January 26, 2026 15:00
@nicolas-grekas
Copy link
Copy Markdown
Member

I rebase the PR on 7.3 with some LLM help, but I think the issue remains with legacy type. Do we need to throw when the legacy API is used? I'd also need help to properly describe generics using TypeInfo

nicolas-grekas added a commit that referenced this pull request Jan 27, 2026
…lock >= 6 (all branches) (nicolas-grekas)

This PR was merged into the 7.3 branch.

Discussion
----------

[PropertyInfo] Conflict with phpdocumentor/reflection-docblock >= 6 (all branches)

| Q             | A
| ------------- | ---
| Branch?       | 7.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #63179
| License       | MIT

Same as #63193 for newest branches.

Support for v6 should be provided by #62887 once its ready.

Commits
-------

a8687cf [PropertyInfo] Conflict with phpdocumentor/reflection-docblock >= 6
@nicolas-grekas
Copy link
Copy Markdown
Member

Let's continue on #63235

@xabbuh xabbuh deleted the reflection-docblock-6 branch January 29, 2026 15:53
nicolas-grekas added a commit that referenced this pull request Feb 5, 2026
…bility (mtarld)

This PR was merged into the 7.4 branch.

Discussion
----------

[PropertyInfo] phpdocumentor/reflection-docblock 6 compatibility

| Q             | A
| ------------- | ---
| Branch?       | 7.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #63179
| License       | MIT

Superseed #62887

Commits
-------

f96ff94 [PropertyInfo] fix compatibility with phpdocumentor/reflection-docblock 6.x
symfony-splitter pushed a commit to symfony/framework-bundle that referenced this pull request Feb 5, 2026
…bility (mtarld)

This PR was merged into the 7.4 branch.

Discussion
----------

[PropertyInfo] phpdocumentor/reflection-docblock 6 compatibility

| Q             | A
| ------------- | ---
| Branch?       | 7.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #63179
| License       | MIT

Superseed symfony/symfony#62887

Commits
-------

f96ff9492bd [PropertyInfo] fix compatibility with phpdocumentor/reflection-docblock 6.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants