post-O.7 Fix 1 (K.1): move arr clients to phlex-shared#2
Merged
Conversation
The K.1 plan (typed Sonarr/Radarr/Bazarr/Prowlarr clients) explicitly
requires these to live in phlex-shared so both phlex-server AND phlex-hub
can consume them. The post-O.7 architecture review found them living in
phlex-server/src/Arr/ instead.
Moved to phlex-shared (namespace Phlex\Shared\Arr):
- ArrClientInterface
- ArrClientFactory
- SyncResult (DTO)
- SonarrClient, RadarrClient, BazarrClient, ProwlarrClient (typed HTTP clients)
- TrashGuidesProvider (URL-only fetcher)
Stayed in phlex-server (Workerman MySQL coupling):
- CustomFormatSyncer — orchestrates sync writes via $db->query(); will be
updated in the companion phlex-server PR to import Phlex\Shared\Arr\*.
Logger swap: arr classes now type-hint Psr\Log\LoggerInterface instead of
phlex-server's concrete Phlex\Common\Logger\StructuredLogger. Adds psr/log
to composer.json runtime deps.
Interface fix: ArrClientInterface::getQueue() PHPDoc now reflects the real
Sonarr/Radarr paginated response shape ({records, page, pageSize, ...})
rather than the incorrect array<int, array<string, mixed>> claim.
Bumps Version::VERSION 0.3.0 -> 0.4.0 and adds CHANGELOG entry. phpunit
164/164 green, phpstan level 9 clean (full tree including tests/), phpcs
PSR-12 clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Wave 4 architecture correction (K.1): the typed Sonarr/Radarr/Bazarr/Prowlarr HTTP clients lived in
phlex-server/src/Arr/instead ofphlex-shared/src/Arr/as plan §4.3 + step K.1 explicitly require, so phlex-hub couldn't consume them. This PR moves them.Moved here (namespace
Phlex\Shared\Arr)ArrClientInterface,ArrClientFactorySyncResult(immutable DTO)SonarrClient,RadarrClient,BazarrClient,ProwlarrClientTrashGuidesProvider(URL-only fetcher)Stayed in phlex-server
CustomFormatSyncer— still tightly coupled toWorkerman\MySQL\Connection. The companion phlex-server PR (post-o7-fixes/k1-arr-consume) updates it to importPhlex\Shared\Arr\*.Other changes
Phlex\Common\Logger\StructuredLogger(server-specific concrete class) forPsr\Log\LoggerInterface. Addedpsr/log: ^3.0to composer.json.ArrClientInterface::getQueue()PHPDoc now reflects the real Sonarr/Radarr paginated response ({records, page, pageSize, totalRecords}) instead of the incorrect list shape.Version::VERSION0.3.0->0.4.0. CHANGELOG entry added.Test plan
vendor/bin/phpunit --no-coverage-> 164/164 greenvendor/bin/phpstan analyze --no-progress(level 9, src + tests) -> cleanvendor/bin/phpcs --standard=PSR12 src/-> cleanv0.4.0after merge and push tagGenerated with Claude Code