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:
16
lib/Service/Audit/ApiSystemAuditReporterInterface.php
Normal file
16
lib/Service/Audit/ApiSystemAuditReporterInterface.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace MintyPHP\Service\Audit;
|
||||
|
||||
/**
|
||||
* Core-side contract for API system-level audit reporting.
|
||||
*
|
||||
* Implemented by the audit module's ApiSystemAuditReporter when the module is active.
|
||||
* Falls back to NullApiSystemAuditReporter (no-op) when the audit module is disabled.
|
||||
*/
|
||||
interface ApiSystemAuditReporterInterface
|
||||
{
|
||||
public function start(): void;
|
||||
|
||||
public function finish(int $statusCode, ?string $errorCode = null): void;
|
||||
}
|
||||
Reference in New Issue
Block a user