Skip to content

Access "response" of CoreAdmin queries#1167

Merged
mkalkbrenner merged 1 commit intosolariumphp:masterfrom
thomascorthals:response
Nov 15, 2025
Merged

Access "response" of CoreAdmin queries#1167
mkalkbrenner merged 1 commit intosolariumphp:masterfrom
thomascorthals:response

Conversation

@thomascorthals
Copy link
Member

CoreAdmin queries can have a field named "response" in the JSON response data. Parsing that data assigned its value (of type array) to Solarium\Core\Query\Result\Result::$response (of type Solarium\Core\Client\Response).

This caused a TypeError when calling Result::getResponse() to get the Response object.

TypeError: Solarium\Core\Query\Result\Result::getResponse(): Return value must be of type Solarium\Core\Client\Response, array returned

It also caused an Error when trying to access Result::$response to get the value.

Error: Cannot access protected property Solarium\Tests\QueryType\Server\CoreAdmin\Result\Result::$response

This PR fixes both problems by storing it under a different property name but making it accessible under its original name through property overloading.

@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.16%. Comparing base (8bc45a0) to head (6fcf1e9).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1167      +/-   ##
==========================================
+ Coverage   98.13%   98.16%   +0.02%     
==========================================
  Files         404      404              
  Lines       10626    10632       +6     
==========================================
+ Hits        10428    10437       +9     
+ Misses        198      195       -3     
Flag Coverage Δ
unittests 98.16% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thomascorthals thomascorthals changed the title Access "response" of CoreAdmion queries Access "response" of CoreAdmin queries Nov 14, 2025
@mkalkbrenner mkalkbrenner merged commit af81c91 into solariumphp:master Nov 15, 2025
28 checks passed
@thomascorthals thomascorthals deleted the response branch November 16, 2025 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants