You've already forked phpmyadmin
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:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user