implement TokenRequestResolveEvent

This commit is contained in:
Artem Vasilev 2024-03-14 16:31:18 +03:00
parent 8cf69e1968
commit f4ad545ba5

View File

@ -0,0 +1,31 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_oauthserver
*
* @copyright (c) 2024. Webmasterskaya. <https://webmasterskaya.xyz>
* @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;
}
}