Skip to content
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

[6.x] Implement ArrayAccess on JsonResponse + TestResponse #30817

Merged
merged 9 commits into from Dec 11, 2019

Conversation

@taylorotwell
Copy link
Member

taylorotwell commented Dec 11, 2019

When building / testing and JSON API, I like to sometimes interact with the raw JSON payload returned in the response. Normally you would have to access this via $response->original['foo']; however, with this change I implement ArrayAccess on both JsonResponse and TestResponse in order to be able to proxy directly into the response JSON without going through the original property.

image

…into array-access-response
…into array-access-response
@taylorotwell taylorotwell merged commit f5c3c60 into 6.x Dec 11, 2019
2 of 4 checks passed
2 of 4 checks passed
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/styleci/push The analysis has passed
Details
@taylorotwell taylorotwell deleted the array-access-response branch Dec 11, 2019
@GrahamCampbell GrahamCampbell changed the title Implement ArrayAccess on JsonResponse + TestResponse [6.x] Implement ArrayAccess on JsonResponse + TestResponse Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.