lib/aw/audit/EventSubscriber/AuditEventSubscriber.php line 33
<?phpdeclare(strict_types=1);namespace Aw\Auditor\EventSubscriber;use Aw\Auditor\Auditor;use Aw\Auditor\Event\LifecycleEvent;use Exception;use Symfony\Component\EventDispatcher\EventSubscriberInterface;/*** @see \Aw\Auditor\Tests\EventSubscriber\AuditEventSubscriberTest*/class AuditEventSubscriber implements EventSubscriberInterface{private Auditor $auditor;public function __construct(Auditor $auditor){$this->auditor = $auditor;}public static function getSubscribedEvents(): array{return [LifecycleEvent::class => [['onAuditEvent', -1_000_000], // should be fired last],];}public function onAuditEvent(LifecycleEvent $event): LifecycleEvent{foreach ($this->auditor->getProviders() as $provider) {if ($provider->supportsStorage()) {try {$provider->persist($event);} catch (Exception) {// do nothing to ensure other providers are called}}}return $event;}}