phpmyadmin/libraries/classes/Controllers/Export/TablesController.php
Maurício Meneghini Fauth 3531775b7c
Add type declarations to the controllers contructors
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-11 17:32:22 -03:00

37 lines
903 B
PHP

<?php
declare(strict_types=1);
namespace PhpMyAdmin\Controllers\Export;
use PhpMyAdmin\Controllers\AbstractController;
use PhpMyAdmin\Controllers\Database\ExportController;
use PhpMyAdmin\ResponseRenderer;
use PhpMyAdmin\Template;
use function __;
final class TablesController extends AbstractController
{
/** @var ExportController */
private $exportController;
public function __construct(ResponseRenderer $response, Template $template, ExportController $exportController)
{
parent::__construct($response, $template);
$this->exportController = $exportController;
}
public function __invoke(): void
{
if (empty($_POST['selected_tbl'])) {
$this->response->setRequestStatus(false);
$this->response->addJSON('message', __('No table selected.'));
return;
}
($this->exportController)();
}
}