Skip to content

post-O.7 Fix 1 (K.1): move arr clients to phlex-shared#2

Merged
detain merged 2 commits into
masterfrom
post-o7-fixes/k1-arr-move
May 19, 2026
Merged

post-O.7 Fix 1 (K.1): move arr clients to phlex-shared#2
detain merged 2 commits into
masterfrom
post-o7-fixes/k1-arr-move

Conversation

@detain
Copy link
Copy Markdown
Owner

@detain detain commented May 19, 2026

Summary

Wave 4 architecture correction (K.1): the typed Sonarr/Radarr/Bazarr/Prowlarr HTTP clients lived in phlex-server/src/Arr/ instead of phlex-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, ArrClientFactory
  • SyncResult (immutable DTO)
  • SonarrClient, RadarrClient, BazarrClient, ProwlarrClient
  • TrashGuidesProvider (URL-only fetcher)

Stayed in phlex-server

  • CustomFormatSyncer — still tightly coupled to Workerman\MySQL\Connection. The companion phlex-server PR (post-o7-fixes/k1-arr-consume) updates it to import Phlex\Shared\Arr\*.

Other changes

  • Logger: swapped Phlex\Common\Logger\StructuredLogger (server-specific concrete class) for Psr\Log\LoggerInterface. Added psr/log: ^3.0 to composer.json.
  • Interface fix: ArrClientInterface::getQueue() PHPDoc now reflects the real Sonarr/Radarr paginated response ({records, page, pageSize, totalRecords}) instead of the incorrect list shape.
  • Version bump: Version::VERSION 0.3.0 -> 0.4.0. CHANGELOG entry added.

Test plan

  • vendor/bin/phpunit --no-coverage -> 164/164 green
  • vendor/bin/phpstan analyze --no-progress (level 9, src + tests) -> clean
  • vendor/bin/phpcs --standard=PSR12 src/ -> clean
  • tag v0.4.0 after merge and push tag

Generated with Claude Code

detain and others added 2 commits May 17, 2026 12:00
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>
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@detain detain merged commit 1e94837 into master May 19, 2026
5 of 6 checks passed
@detain detain deleted the post-o7-fixes/k1-arr-move branch May 19, 2026 02:21
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.

1 participant