refactor(audit): decouple API audit classes from core via interfaces
Core code (lib/) no longer imports any MintyPHP\Module\Audit\* classes directly. New ApiAuditServiceInterface and ApiSystemAuditReporterInterface follow the existing pattern (interface + null implementation in core, concrete binding from module registrar). DoctorRunner and helpers/app.php now resolve through DI interfaces, ensuring the audit module remains fully optional. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,10 +8,10 @@ use MintyPHP\App\AppContainer;
|
||||
use MintyPHP\App\Bootstrap\EnvValidator;
|
||||
use MintyPHP\Console\Support\CliAppBootstrap;
|
||||
use MintyPHP\DB;
|
||||
use MintyPHP\Module\Audit\Service\SystemAuditService;
|
||||
use MintyPHP\Service\Access\AuthorizationService;
|
||||
use MintyPHP\Service\Access\PermissionService;
|
||||
use MintyPHP\Service\Access\UiAccessService;
|
||||
use MintyPHP\Service\Audit\AuditRecorderInterface;
|
||||
use MintyPHP\Service\Auth\AuthService;
|
||||
use Throwable;
|
||||
|
||||
@@ -283,7 +283,7 @@ final class DoctorRunner implements DoctorRunnerInterface
|
||||
$durationMs = max(0, (int) round((microtime(true) - $startedAt) * 1000));
|
||||
|
||||
try {
|
||||
app(SystemAuditService::class)->record(
|
||||
app(AuditRecorderInterface::class)->record(
|
||||
'cli.command',
|
||||
$exitCode === 0 ? 'success' : 'failed',
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user