-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[PropertyInfo] Allow nested collections #28012
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
Conversation
There is another change you left out For: /** @var mixed[][] */ before: builtintype: array
collectionKeyType: null
collectionValueType: null after: builtintype: array
collectionKeyType:
builtintype: int
collectionValueType:
builtintype: array |
Hi @ostrolucky , I agreed, that I didn't handle the
(because of line 92) can you please double check? Which led to a different behavior for the field |
I double checked. Please write unit test for this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(for 2.8, PR welcome if the bug exists there also I suppose)
@@ -38,6 +38,7 @@ public function testGetProperties() | |||
'bal', | |||
'parent', | |||
'collection', | |||
'deepCollection', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A very minor comment: is there any reason for calling this deepCollection
instead of nestedCollection
? The nested one sounds more natural to me. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
mixed[][] behavior not clarified. What's the consensus? Seems there is different behavior currently than expected by author |
Also, not sure it's right to always use |
I reverted changes on now
|
This PR was merged into the 2.8 branch. Discussion ---------- [PropertyInfo] Allow nested collections | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Duplicate of #28012 for the 2.8 branche (as both code and test have been refactored between 2.8 and 3.x Commits ------- 6331687 Allow multidimensional collection in property info
Thank you @jderusse. |
This PR was merged into the 3.4 branch. Discussion ---------- [PropertyInfo] Allow nested collections | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | NA | License | MIT | Doc PR | NA When a multidimentional collection is defined (in a docblock) the extractor does not resolve the className deeply ``` #input class Foo { /** * @var Baz[][] */ public $bar; } ``` ``` # current result builtinType: array collectionValueType: builtinType: object class: Baz[] ``` ``` # FIX builtinType: array collectionValueType: builtinType: array collectionValueType: builtinType: object class: Baz ``` The 2.8 version has also that bug, but the methods have been moved to another class. Should I create an other PR for 2.8? Commits ------- ce49036 Allow multidimensional collection in property info
@jderusse or anyone else: PropertyInfo 3.4 is red currently, could you have a look please? |
cheking it |
@nicolas-grekas shouldn't it be fixed by fe482cc ? |
Looks like so. It wasn't passing locally, but I suppose that's because I didn't run composer update before... Sorry for the false alarm. |
When merging into master, I added this commit to make tests pass: a5516fc Please check and submit a PR if the patch should be improved. |
When a multidimentional collection is defined (in a docblock) the extractor does not resolve the className deeply
The 2.8 version has also that bug, but the methods have been moved to another class. Should I create an other PR for 2.8?