From f4ad545ba57b53f717edb7c58435b40faef43844 Mon Sep 17 00:00:00 2001 From: Artem Vasilev Date: Thu, 14 Mar 2024 16:31:18 +0300 Subject: [PATCH] implement TokenRequestResolveEvent --- .../src/Event/TokenRequestResolveEvent.php | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 com_oauthserver/administrator/src/Event/TokenRequestResolveEvent.php diff --git a/com_oauthserver/administrator/src/Event/TokenRequestResolveEvent.php b/com_oauthserver/administrator/src/Event/TokenRequestResolveEvent.php new file mode 100644 index 0000000..23dbaa2 --- /dev/null +++ b/com_oauthserver/administrator/src/Event/TokenRequestResolveEvent.php @@ -0,0 +1,31 @@ + + * @license MIT; see LICENSE.txt + **/ + +namespace Webmasterskaya\Component\OauthServer\Administrator\Event; + +use Joomla\CMS\Event\AbstractEvent; +use Psr\Http\Message\ResponseInterface; + +class TokenRequestResolveEvent extends AbstractEvent +{ + public function __construct(string $name, array $arguments = []) + { + if (!array_key_exists('response', $arguments)) + { + throw new \BadMethodCallException("Argument 'response' is required for event $name"); + } + + parent::__construct($name, $arguments); + } + + public function onSetResponse(ResponseInterface $response): ResponseInterface + { + return $response; + } +}