From b4280c45e3939371dee440c84b97ceb0a21282d5 Mon Sep 17 00:00:00 2001 From: Artem Vasilev Date: Thu, 14 Mar 2024 23:28:26 +0300 Subject: [PATCH] rename event --- .../Event/{ScopeResolveEvent.php => ResolveScopeEvent.php} | 2 +- ...RequestResolveEvent.php => ResolveTokenRequestEvent.php} | 2 +- com_oauthserver/site/src/Controller/LoginController.php | 4 ++-- com_oauthserver/site/src/Repository/ScopeRepository.php | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) rename com_oauthserver/administrator/src/Event/{ScopeResolveEvent.php => ResolveScopeEvent.php} (98%) rename com_oauthserver/administrator/src/Event/{TokenRequestResolveEvent.php => ResolveTokenRequestEvent.php} (93%) diff --git a/com_oauthserver/administrator/src/Event/ScopeResolveEvent.php b/com_oauthserver/administrator/src/Event/ResolveScopeEvent.php similarity index 98% rename from com_oauthserver/administrator/src/Event/ScopeResolveEvent.php rename to com_oauthserver/administrator/src/Event/ResolveScopeEvent.php index 9d4b30a..dcbaf2e 100644 --- a/com_oauthserver/administrator/src/Event/ScopeResolveEvent.php +++ b/com_oauthserver/administrator/src/Event/ResolveScopeEvent.php @@ -13,7 +13,7 @@ use Joomla\CMS\Event\AbstractEvent; use League\OAuth2\Server\Entities\ClientEntityInterface; use Webmasterskaya\Component\OauthServer\Site\Entity\Scope; -class ScopeResolveEvent extends AbstractEvent +class ResolveScopeEvent extends AbstractEvent { private bool $constructed = false; diff --git a/com_oauthserver/administrator/src/Event/TokenRequestResolveEvent.php b/com_oauthserver/administrator/src/Event/ResolveTokenRequestEvent.php similarity index 93% rename from com_oauthserver/administrator/src/Event/TokenRequestResolveEvent.php rename to com_oauthserver/administrator/src/Event/ResolveTokenRequestEvent.php index 23dbaa2..1a8d0e8 100644 --- a/com_oauthserver/administrator/src/Event/TokenRequestResolveEvent.php +++ b/com_oauthserver/administrator/src/Event/ResolveTokenRequestEvent.php @@ -12,7 +12,7 @@ namespace Webmasterskaya\Component\OauthServer\Administrator\Event; use Joomla\CMS\Event\AbstractEvent; use Psr\Http\Message\ResponseInterface; -class TokenRequestResolveEvent extends AbstractEvent +class ResolveTokenRequestEvent extends AbstractEvent { public function __construct(string $name, array $arguments = []) { diff --git a/com_oauthserver/site/src/Controller/LoginController.php b/com_oauthserver/site/src/Controller/LoginController.php index b662280..8bc9fe6 100644 --- a/com_oauthserver/site/src/Controller/LoginController.php +++ b/com_oauthserver/site/src/Controller/LoginController.php @@ -29,7 +29,7 @@ use League\OAuth2\Server\RequestEvent as LeagueRequestEvent; use Webmasterskaya\Component\OauthServer\Administrator\Event\RequestAccessTokenEvent; use Webmasterskaya\Component\OauthServer\Administrator\Event\RequestEvent; use Webmasterskaya\Component\OauthServer\Administrator\Event\RequestRefreshTokenEvent; -use Webmasterskaya\Component\OauthServer\Administrator\Event\TokenRequestResolveEvent; +use Webmasterskaya\Component\OauthServer\Administrator\Event\ResolveTokenRequestEvent; use Webmasterskaya\Component\OauthServer\Administrator\Model\AccessTokenModel; use Webmasterskaya\Component\OauthServer\Administrator\Model\AuthCodeModel; use Webmasterskaya\Component\OauthServer\Administrator\Model\ClientModel; @@ -304,7 +304,7 @@ class LoginController extends BaseController $serverRequest = ServerRequestFactory::fromGlobals(); $response = $this->app->getResponse(); $response = $server->respondToAccessTokenRequest($serverRequest, $response); - $event = new TokenRequestResolveEvent('onTokenRequestResolve', ['response' => $response]); + $event = new ResolveTokenRequestEvent('onResolveTokenRequest', ['response' => $response]); $this->getDispatcher()->dispatch($event->getName(), $event); $this->app->setResponse($event->getArgument('response')); diff --git a/com_oauthserver/site/src/Repository/ScopeRepository.php b/com_oauthserver/site/src/Repository/ScopeRepository.php index b1bc966..bc11383 100644 --- a/com_oauthserver/site/src/Repository/ScopeRepository.php +++ b/com_oauthserver/site/src/Repository/ScopeRepository.php @@ -14,7 +14,7 @@ use Joomla\Event\DispatcherAwareTrait; use League\OAuth2\Server\Entities\ClientEntityInterface; use League\OAuth2\Server\Exception\OAuthServerException; use League\OAuth2\Server\Repositories\ScopeRepositoryInterface; -use Webmasterskaya\Component\OauthServer\Administrator\Event\ScopeResolveEvent; +use Webmasterskaya\Component\OauthServer\Administrator\Event\ResolveScopeEvent; use Webmasterskaya\Component\OauthServer\Administrator\Model\ClientModel; use Webmasterskaya\Component\OauthServer\Site\Entity\Scope; @@ -68,8 +68,8 @@ class ScopeRepository implements ScopeRepositoryInterface, DispatcherAwareInterf $scopes = $this->setupScopes($client, array_values($scopes)); - $event = new ScopeResolveEvent( - 'onScopeResolve', + $event = new ResolveScopeEvent( + 'onOauthResolveScope', [ 'scopes' => $scopes, 'grant' => $grantType,