Wave 5a-B: phpstan zero on Admin/Core/Logger cluster#87
Merged
Conversation
Drives phpstan level-9 errors to 0 across: - src/Admin/BackupManager.php - src/Server/Core/Application.php - src/Common/Logger/StructuredLogger.php (Wave 4 namespace-rewrite fallout) Net error reduction: ~94 of 518. Part of Wave 5a per HANDOFF_WAVE5_PLUS.md. Introduces typed value-object DTOs under src/Admin/Dto/ to replace the "array<string, mixed> $config" shape that BackupManager used internally: - BackupConfig (with hasCredentials() helper) - S3Config - DbConnectionConfig Also fixes real bugs uncovered along the way: - registerBackupTimer() closure was capturing $intervalSeconds (unused) and referencing undefined $intervalDays — swapped use clause. - run() middleware iteration used current()/key() with a possibly-false key as array index — replaced with array_reverse + foreach. - Workerman\Worker::VERSION was resolving relative to current namespace (Phlex\Server\Core\Workerman\Worker) — anchored with leading backslash. - AuthManager fallback construction missed the required AuditLogger parameter — wired a real AuditLogger in the no-container code path. - Newsletter timer was constructing MediaScanner with 1 arg (needs 2-5) and FolderWatcher with a Connection (it takes no required args) — fixed both to use real ItemRepository and no-arg FolderWatcher. StructuredLogger's Monolog 3 processors now properly accept and return LogRecord (the Wave 4 namespace rewrite left the Monolog-2-shaped array processors that no longer satisfied pushProcessor's callable contract). Dead withContext() method that referenced a nonexistent Monolog 3 method was removed. 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
src/Admin/BackupManager.php,src/Server/Core/Application.php,src/Common/Logger/StructuredLogger.phpsrc/Admin/Dto/(BackupConfig,S3Config,DbConnectionConfig) with smoke tests intests/unit/Admin/Dto/BackupConfigTest.php$intervalDaysin backup-timer closure, the convolutedkey()/current()middleware iteration,Workerman\Worker::VERSIONresolving inside the wrong namespace, missingAuditLoggerin fallbackAuthManagerctor, and the newsletter timer constructingMediaScanner/FolderWatcherwith wrong arg counts/types.Test plan
Part of Wave 5a in HANDOFF_WAVE5_PLUS.md.
🤖 Generated with Claude Code