1
0
mirror of https://github.com/phpmyadmin/phpmyadmin.git synced 2026-10-23 18:29:15 +03:00

Create InvocableController interface

This creates the contract for the controllers.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
Maurício Meneghini Fauth
2024-04-03 17:03:00 -03:00
parent 65b96aa44d
commit 181f971bc9
202 changed files with 1630 additions and 715 deletions

View File

@@ -8,6 +8,7 @@ use Fig\Http\Message\StatusCodeInterface;
use JsonException;
use PhpMyAdmin\Http\Factory\ResponseFactory;
use PhpMyAdmin\Http\Response;
use PhpMyAdmin\Http\ServerRequest;
use function __;
use function _pgettext;
@@ -21,13 +22,13 @@ use const JSON_THROW_ON_ERROR;
/**
* Exporting of translated messages from PHP to JavaScript.
*/
final class JavaScriptMessagesController
final class JavaScriptMessagesController implements InvocableController
{
public function __construct(private readonly ResponseFactory $responseFactory)
{
}
public function __invoke(): Response
public function __invoke(ServerRequest $request): Response
{
$response = $this->responseFactory->createResponse()
->withHeader('Content-Type', 'text/javascript; charset=UTF-8')