Skip to content

fix: AdminClient::getClusterStatus validate json_decode result (#44) - #58

Merged
s2x merged 2 commits into
masterfrom
fix/cluster-status-validation-44
Jul 3, 2026
Merged

fix: AdminClient::getClusterStatus validate json_decode result (#44)#58
s2x merged 2 commits into
masterfrom
fix/cluster-status-validation-44

Conversation

@s2x

@s2x s2x commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #44

Added proper validation for json_decode() result in AdminClient::getClusterStatus():

  • Added JSON_THROW_ON_ERROR flag to catch malformed JSON
  • Added is_array() check on decoded value, throwing RuntimeException for non-object results
  • Extracted decode-and-validate logic into private method for testability
  • Added 8 unit tests covering all edge cases

Testing

  • composer test:unit — all 326 tests pass (8 new + 318 existing)
  • composer lint — passes (only pre-existing Tuple.php PHPStan errors)

@s2x
s2x merged commit 9dc3525 into master Jul 3, 2026
5 of 6 checks passed
@s2x
s2x deleted the fix/cluster-status-validation-44 branch July 3, 2026 21:05
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.

[Bug] AdminClient::getClusterStatus does not validate json_decode result

1 participant