fix compatibility with phpdocumentor/reflection-docblock 6.x#62887
fix compatibility with phpdocumentor/reflection-docblock 6.x#62887xabbuh wants to merge 1 commit into
Conversation
c519574 to
5e9a9c9
Compare
| } | ||
|
|
||
| if ($docType instanceof Collection) { | ||
| if ($docType instanceof Collection || $docType instanceof Generic) { |
There was a problem hiding this comment.
Collection got replaced with Generic in phpDocumentor/TypeResolver#238
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@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.
There was a problem hiding this comment.
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
jaapio
left a comment
There was a problem hiding this comment.
Added a few comments on the changes
|
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). |
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. |
|
My main concern is that we only have conflict rules for the lower boundary: So Composer would allow the installation of |
|
see #62887 (comment) |
5e9a9c9 to
c97b857
Compare
nicolas-grekas
left a comment
There was a problem hiding this comment.
Let's target branch 7.3. See #63126 for 6.4
…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)
|
Ready for a rebase on 7.3 |
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
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
d156a90 to
a455c2f
Compare
|
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 |
…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
a455c2f to
cd596e8
Compare
|
Let's continue on #63235 |
…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
…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
Uh oh!
There was an error while loading. Please reload this page.