AbstractEntity::build(): Fix \stdClass as array type errors. #354
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.
I've been getting these errors when trying to use the API:
At first I thought it was something to do with using
php-http/react-adapter:^4.0
instead ofguzzlehttp/guzzle:^7.9.2
which is what you seem to test against, but given that you use HTTPlug, it shouldn't matter. Guzzle also produces the same error for me, so that seems to make that unlikely to be the cause.Digging through the code, I figured the best place to handle this would be in
AbstractEntity::build()
because it seems to address similar errors others have encountered and may fix future errors due to the same cause of getting a\stdClass
and attempting to set that to anarray
typed property. See #347, #348, and #350.This is under PHP 8.3.25 and DDEV 1.24.8 so I don't know if the
\stdClass
thing is a quirk of combination of those and/or whatever other packages I'm using, but this allows the API to work correctly for me when I try to get a list of apps, for example.