From 818885729d515866d11d66a6375bada93924ccb0 Mon Sep 17 00:00:00 2001 From: Sajjad Hashemian Date: Wed, 6 Jun 2018 09:40:29 +0430 Subject: [PATCH] rename TokenController to CreateTokenController --- .../{TokenController.php => CreateTokenController.php} | 2 +- framework/core/src/Api/routes.php | 2 +- framework/core/src/Forum/Controller/LogInController.php | 4 ++-- ...okenControllerTest.php => CreateTokenControllerTest.php} | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) rename framework/core/src/Api/Controller/{TokenController.php => CreateTokenController.php} (96%) rename framework/core/tests/Api/Controller/{TokenControllerTest.php => CreateTokenControllerTest.php} (84%) diff --git a/framework/core/src/Api/Controller/TokenController.php b/framework/core/src/Api/Controller/CreateTokenController.php similarity index 96% rename from framework/core/src/Api/Controller/TokenController.php rename to framework/core/src/Api/Controller/CreateTokenController.php index 268f4a598..563bd9ed1 100644 --- a/framework/core/src/Api/Controller/TokenController.php +++ b/framework/core/src/Api/Controller/CreateTokenController.php @@ -21,7 +21,7 @@ use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; use Zend\Diactoros\Response\JsonResponse; -class TokenController implements RequestHandlerInterface +class CreateTokenController implements RequestHandlerInterface { /** * @var \Flarum\User\UserRepository diff --git a/framework/core/src/Api/routes.php b/framework/core/src/Api/routes.php index c532f7e03..8e3ccd2f3 100644 --- a/framework/core/src/Api/routes.php +++ b/framework/core/src/Api/routes.php @@ -25,7 +25,7 @@ return function (RouteCollection $map, RouteHandlerFactory $route) { $map->post( '/token', 'token', - $route->toController(Controller\TokenController::class) + $route->toController(Controller\CreateTokenController::class) ); // Send forgot password email diff --git a/framework/core/src/Forum/Controller/LogInController.php b/framework/core/src/Forum/Controller/LogInController.php index cf62d81e9..7e91168fd 100644 --- a/framework/core/src/Forum/Controller/LogInController.php +++ b/framework/core/src/Forum/Controller/LogInController.php @@ -12,7 +12,7 @@ namespace Flarum\Forum\Controller; use Flarum\Api\Client; -use Flarum\Api\Controller\TokenController; +use Flarum\Api\Controller\CreateTokenController; use Flarum\Http\AccessToken; use Flarum\Http\Rememberer; use Flarum\Http\SessionAuthenticator; @@ -67,7 +67,7 @@ class LogInController implements RequestHandlerInterface $body = $request->getParsedBody(); $params = array_only($body, ['identification', 'password']); - $response = $this->apiClient->send(TokenController::class, $actor, [], $params); + $response = $this->apiClient->send(CreateTokenController::class, $actor, [], $params); if ($response->getStatusCode() === 200) { $data = json_decode($response->getBody()); diff --git a/framework/core/tests/Api/Controller/TokenControllerTest.php b/framework/core/tests/Api/Controller/CreateTokenControllerTest.php similarity index 84% rename from framework/core/tests/Api/Controller/TokenControllerTest.php rename to framework/core/tests/Api/Controller/CreateTokenControllerTest.php index a350fa823..82d0f6de3 100644 --- a/framework/core/tests/Api/Controller/TokenControllerTest.php +++ b/framework/core/tests/Api/Controller/CreateTokenControllerTest.php @@ -11,15 +11,15 @@ namespace Flarum\Tests\Api\Controller; -use Flarum\Api\Controller\TokenController; +use Flarum\Api\Controller\CreateTokenController; use Flarum\Http\AccessToken; use Flarum\Tests\Test\Concerns\RetrievesAuthorizedUsers; -class TokenControllerTest extends ApiControllerTestCase +class CreateTokenControllerTest extends ApiControllerTestCase { use RetrievesAuthorizedUsers; - protected $controller = TokenController::class; + protected $controller = CreateTokenController::class; /** * @test