bug: Fix parsing of edge cases phpdoc types#6977
Merged
Wirone merged 15 commits intoPHP-CS-Fixer:masterfrom May 22, 2023
Merged
bug: Fix parsing of edge cases phpdoc types#6977Wirone merged 15 commits intoPHP-CS-Fixer:masterfrom
Wirone merged 15 commits intoPHP-CS-Fixer:masterfrom
Conversation
8e076cc to
e134568
Compare
8712f9f to
b05ec6c
Compare
Merged
Wirone
requested changes
May 20, 2023
|
|
||
| /** | ||
| * @return iterable<string[]|(string|null|array<string, string>)[]> | ||
| * @return iterable<(null|array<string, string>|string)[]|string[]> |
Member
There was a problem hiding this comment.
Isn't actually:
Suggested change
| * @return iterable<(null|array<string, string>|string)[]|string[]> | |
| * @return iterable<array<null|string|array<string, string>>> |
??
I know it's not a part of this PR, but looking at it, seems overcomplicated. Not a something you should change, I would want to discuss it and create separate PR if needed.
Contributor
Author
There was a problem hiding this comment.
The best phpdoc here would be using array shape, ie. iterable<array{ string, null|string, null|array<string, string> }>.
Co-authored-by: Greg Korba <wirone@gmail.com>
Wirone
approved these changes
May 20, 2023
Member
Wirone
left a comment
There was a problem hiding this comment.
@kubawerlos please take a look too 🙂.
kubawerlos
approved these changes
May 22, 2023
Member
kubawerlos
left a comment
There was a problem hiding this comment.
Tests are convincing me, the only thing I'm afraid that one day @julienfalque will come and will ask "what the heck did you do to the coll regex I've created?" :D
Member
|
Thank you @mvorisek 🍻 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
heavily inspired by phpstan phpdoc grammar and its test cases