diff options
-rw-r--r-- | libraries/classes/Controllers/Import/ImportController.php (renamed from libraries/classes/Controllers/ImportController.php) | 5 | ||||
-rw-r--r-- | libraries/classes/Controllers/Import/StatusController.php (renamed from libraries/classes/Controllers/ImportStatusController.php) | 4 | ||||
-rw-r--r-- | libraries/routes.php | 7 | ||||
-rw-r--r-- | libraries/services_controllers.php | 11 | ||||
-rw-r--r-- | phpstan-baseline.neon | 6 | ||||
-rw-r--r-- | psalm-baseline.xml | 4 | ||||
-rw-r--r-- | test/classes/Controllers/Import/ImportControllerTest.php (renamed from test/classes/Controllers/ImportControllerTest.php) | 6 |
7 files changed, 21 insertions, 22 deletions
diff --git a/libraries/classes/Controllers/ImportController.php b/libraries/classes/Controllers/Import/ImportController.php index b47bb87525..612becaec4 100644 --- a/libraries/classes/Controllers/ImportController.php +++ b/libraries/classes/Controllers/Import/ImportController.php @@ -2,11 +2,12 @@ declare(strict_types=1); -namespace PhpMyAdmin\Controllers; +namespace PhpMyAdmin\Controllers\Import; use PhpMyAdmin\Bookmark; use PhpMyAdmin\ConfigStorage\Relation; use PhpMyAdmin\Console; +use PhpMyAdmin\Controllers\AbstractController; use PhpMyAdmin\Core; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Encoding; @@ -329,7 +330,7 @@ final class ImportController extends AbstractController $reset_charset = false; $msg = 'Sorry an unexpected error happened!'; - /** @var mixed|bool $result */ + /** @var bool|mixed $result */ $result = false; // Bookmark Support: get a query back from bookmark if required diff --git a/libraries/classes/Controllers/ImportStatusController.php b/libraries/classes/Controllers/Import/StatusController.php index 9acbde687e..8813e77f68 100644 --- a/libraries/classes/Controllers/ImportStatusController.php +++ b/libraries/classes/Controllers/Import/StatusController.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace PhpMyAdmin\Controllers; +namespace PhpMyAdmin\Controllers\Import; use PhpMyAdmin\Core; use PhpMyAdmin\Import\Ajax; @@ -20,7 +20,7 @@ use function usleep; /** * Import progress bar backend */ -class ImportStatusController +class StatusController { /** @var Template */ private $template; diff --git a/libraries/routes.php b/libraries/routes.php index 593021508a..65d859991c 100644 --- a/libraries/routes.php +++ b/libraries/routes.php @@ -16,8 +16,7 @@ use PhpMyAdmin\Controllers\Export; use PhpMyAdmin\Controllers\GisDataEditorController; use PhpMyAdmin\Controllers\GitInfoController; use PhpMyAdmin\Controllers\HomeController; -use PhpMyAdmin\Controllers\ImportController; -use PhpMyAdmin\Controllers\ImportStatusController; +use PhpMyAdmin\Controllers\Import; use PhpMyAdmin\Controllers\LicenseController; use PhpMyAdmin\Controllers\LintController; use PhpMyAdmin\Controllers\LogoutController; @@ -120,8 +119,8 @@ return static function (RouteCollector $routes): void { }); $routes->addRoute(['GET', 'POST'], '/gis-data-editor', GisDataEditorController::class); $routes->addRoute(['GET', 'POST'], '/git-revision', GitInfoController::class); - $routes->addRoute(['GET', 'POST'], '/import', ImportController::class); - $routes->addRoute(['GET', 'POST'], '/import-status', ImportStatusController::class); + $routes->addRoute(['GET', 'POST'], '/import', Import\ImportController::class); + $routes->addRoute(['GET', 'POST'], '/import-status', Import\StatusController::class); $routes->get('/license', LicenseController::class); $routes->addRoute(['GET', 'POST'], '/lint', LintController::class); $routes->addRoute(['GET', 'POST'], '/logout', LogoutController::class); diff --git a/libraries/services_controllers.php b/libraries/services_controllers.php index f111dca02b..a7770ccf73 100644 --- a/libraries/services_controllers.php +++ b/libraries/services_controllers.php @@ -15,8 +15,7 @@ use PhpMyAdmin\Controllers\Export; use PhpMyAdmin\Controllers\GisDataEditorController; use PhpMyAdmin\Controllers\GitInfoController; use PhpMyAdmin\Controllers\HomeController; -use PhpMyAdmin\Controllers\ImportController; -use PhpMyAdmin\Controllers\ImportStatusController; +use PhpMyAdmin\Controllers\Import; use PhpMyAdmin\Controllers\JavaScriptMessagesController; use PhpMyAdmin\Controllers\LicenseController; use PhpMyAdmin\Controllers\LintController; @@ -571,8 +570,8 @@ return [ '$dbi' => '@dbi', ], ], - ImportController::class => [ - 'class' => ImportController::class, + Import\ImportController::class => [ + 'class' => Import\ImportController::class, 'arguments' => [ '$response' => '@response', '$template' => '@template', @@ -581,8 +580,8 @@ return [ '$dbi' => '@dbi', ], ], - ImportStatusController::class => [ - 'class' => ImportStatusController::class, + Import\StatusController::class => [ + 'class' => Import\StatusController::class, 'arguments' => ['$template' => '@template'], ], JavaScriptMessagesController::class => [ diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index cf9d281546..1ab2a70bd7 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1293,17 +1293,17 @@ parameters: - message: "#^If condition is always false\\.$#" count: 1 - path: libraries/classes/Controllers/ImportController.php + path: libraries/classes/Controllers/Import/ImportController.php - message: "#^Left side of && is always false\\.$#" count: 1 - path: libraries/classes/Controllers/ImportController.php + path: libraries/classes/Controllers/Import/ImportController.php - message: "#^Negated boolean expression is always true\\.$#" count: 1 - path: libraries/classes/Controllers/ImportController.php + path: libraries/classes/Controllers/Import/ImportController.php - message: "#^Parameter \\#1 \\$dependencies of method PhpMyAdmin\\\\Normalization\\:\\:getHtmlForNewTables3NF\\(\\) expects object, mixed given\\.$#" diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 33e2431882..c3bf258409 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -2066,7 +2066,7 @@ <code>$collationsList</code> </UnusedVariable> </file> - <file src="libraries/classes/Controllers/ImportController.php"> + <file src="libraries/classes/Controllers/Import/ImportController.php"> <DocblockTypeContradiction occurrences="1"> <code>$import_plugin == null</code> </DocblockTypeContradiction> @@ -2201,7 +2201,7 @@ <code>$timeout_passed</code> </TypeDoesNotContainType> </file> - <file src="libraries/classes/Controllers/ImportStatusController.php"> + <file src="libraries/classes/Controllers/Import/StatusController.php"> <MixedArgument occurrences="2"> <code>$_GET['id']</code> <code>$_SESSION['Import_message']['message'] ?? ''</code> diff --git a/test/classes/Controllers/ImportControllerTest.php b/test/classes/Controllers/Import/ImportControllerTest.php index a79a16ed12..31a731d76e 100644 --- a/test/classes/Controllers/ImportControllerTest.php +++ b/test/classes/Controllers/Import/ImportControllerTest.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace PhpMyAdmin\Tests\Controllers; +namespace PhpMyAdmin\Tests\Controllers\Import; -use PhpMyAdmin\Controllers\ImportController; +use PhpMyAdmin\Controllers\Import\ImportController; use PhpMyAdmin\Tests\AbstractTestCase; /** - * @covers \PhpMyAdmin\Controllers\ImportController + * @covers \PhpMyAdmin\Controllers\Import\ImportController */ class ImportControllerTest extends AbstractTestCase { |