fix: satisfy SDK compliance harness 0.8.0#186
Conversation
posthog-php Compliance ReportDate: 2026-06-27 12:40:23 UTC ✅ All Tests Passed!45/45 tests passed Capture Tests✅ 29/29 tests passed View Details
Feature_Flags Tests✅ 16/16 tests passed View Details
|
|
| private function isRetryableStatus(int $responseCode): bool | ||
| { | ||
| return $responseCode === 408 | ||
| || $responseCode === 429 | ||
| || ($responseCode >= 500 && $responseCode <= 600); | ||
| } | ||
|
|
||
| /** | ||
| * @param array<int, string> $headers | ||
| */ | ||
| private function retryAfterMilliseconds(array $headers): ?int |
There was a problem hiding this comment.
isRetryableStatus and retryAfterMilliseconds are declared private, so TrackedHttpClient in adapter.php copy-pastes both methods verbatim (lines 554–587 of adapter.php). Promoting them to protected lets the subclass call $this->isRetryableStatus(...) / $this->retryAfterMilliseconds(...) directly and satisfies OnceAndOnlyOnce.
| private function isRetryableStatus(int $responseCode): bool | |
| { | |
| return $responseCode === 408 | |
| || $responseCode === 429 | |
| || ($responseCode >= 500 && $responseCode <= 600); | |
| } | |
| /** | |
| * @param array<int, string> $headers | |
| */ | |
| private function retryAfterMilliseconds(array $headers): ?int | |
| protected function isRetryableStatus(int $responseCode): bool | |
| { | |
| return $responseCode === 408 | |
| || $responseCode === 429 | |
| || ($responseCode >= 500 && $responseCode <= 600); | |
| } | |
| /** | |
| * @param array<int, string> $headers | |
| */ | |
| protected function retryAfterMilliseconds(array $headers): ?int |
Problem
The SDK compliance workflow and local harness need to use SDK test harness release 0.8.0, with reusable GitHub workflow calls pinned to the release commit SHA instead of a mutable tag/branch. Running the updated harness exposed SDK/adapter compliance gaps in this repository.
Changes
Tests