-
-
Notifications
You must be signed in to change notification settings - Fork 6
fix: add support for enums with single enumeration #681
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
base: main
Are you sure you want to change the base?
Conversation
@@ -50,7 +50,7 @@ public function parse(object $object): self | |||
$struct->deps = $deps; | |||
$struct->parse($item->content, $deps); | |||
|
|||
if (isset($item->content->content[0]->meta->id)) { | |||
if (isset($item->content->content) && is_array($item->content->content) && isset($item->content->content[0]->meta->id)) { |
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.
Is this related to the rest of the changes?
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.
Yes, because the $item->content->content
is not an array when there is only one enumeration.
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.
Is it an object then?
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.
No, in my case it is the value of the enum. In the test you can see an example and there it is a string, see https://github.com/SMillerDev/phpdraft/pull/681/files#diff-b33b2099416ec2a729244bddbbf8f2f3125952aa5d11a6bdfb87f28eef655cbaR335-R337
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.
i think this could be a separate PR, because this change on it's own solve the issues we have right now. i also miss a test for this change
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.
In my personal project I've done worse things for commit grouping. But whatever people do, the CI has to pass.
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.
the reason i said it should be a separate PR, because then that could be merged earlier/separately
No description provided.