<?php
declare(strict_types=1);
namespace App\EventSubscriber;
use Jose\Bundle\JoseFramework\Event\Events;
use Jose\Bundle\JoseFramework\Event\JWSBuiltSuccessEvent;
use Jose\Bundle\JoseFramework\Event\JWSVerificationFailureEvent;
use Jose\Bundle\JoseFramework\Event\JWSVerificationSuccessEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class JwsSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return [
Events::JWS_VERIFICATION_SUCCESS => ['onJwsVerificationSuccess'],
Events::JWS_VERIFICATION_FAILURE => ['onJwsVerificationFailure'],
Events::JWS_BUILT_SUCCESS => ['onJwsBuiltSuccess'],
Events::JWS_BUILT_FAILURE => ['onJwsBuiltFailure'],
];
}
public function onJwsVerificationSuccess(JWSVerificationSuccessEvent $event): void
{
// Do something here
}
public function onJwsVerificationFailure(JWSVerificationFailureEvent $event): void
{
// Do something here
}
public function onJwsBuiltSuccess(JWSBuiltSuccessEvent $event): void
{
// Do something here
}
public function onJwsBuiltFailure(JWSBuiltFailureEvent $event): void
{
// Do something here
}
}