Skip to content

Commit

Permalink
Merge pull request #19156 from MauricioFauth/setup-controllers
Browse files Browse the repository at this point in the history
Refactor setup controllers to implement InvocableController
  • Loading branch information
MauricioFauth committed May 13, 2024
2 parents 6c5c481 + c7963ea commit 510e442
Show file tree
Hide file tree
Showing 28 changed files with 723 additions and 619 deletions.
13 changes: 13 additions & 0 deletions app/services_controllers.php
Expand Up @@ -29,6 +29,7 @@
use PhpMyAdmin\Controllers\Preferences;
use PhpMyAdmin\Controllers\SchemaExportController;
use PhpMyAdmin\Controllers\Server;
use PhpMyAdmin\Controllers\Setup;
use PhpMyAdmin\Controllers\Sql;
use PhpMyAdmin\Controllers\Table;
use PhpMyAdmin\Controllers\TableController;
Expand Down Expand Up @@ -866,6 +867,18 @@
'class' => Server\VariablesController::class,
'arguments' => ['$response' => '@response', '$template' => '@template', '$dbi' => '@dbi'],
],
Setup\MainController::class => [
'class' => Setup\MainController::class,
'arguments' => ['@' . ResponseFactory::class, '@response', '@template', '@config'],
],
Setup\ShowConfigController::class => [
'class' => Setup\ShowConfigController::class,
'arguments' => ['@' . ResponseFactory::class, '@template', '@config'],
],
Setup\ValidateController::class => [
'class' => Setup\ValidateController::class,
'arguments' => ['@' . ResponseFactory::class, '@template', '@config'],
],
Sql\ColumnPreferencesController::class => [
'class' => Sql\ColumnPreferencesController::class,
'arguments' => ['$response' => '@response', '$dbi' => '@dbi'],
Expand Down
142 changes: 16 additions & 126 deletions phpstan-baseline.neon
Expand Up @@ -3025,81 +3025,26 @@ parameters:
count: 1
path: src/Controllers/Operations/ViewController.php

-
message: "#^Cannot call method getConfigArray\\(\\) on mixed\\.$#"
count: 1
path: src/Controllers/Preferences/ExportController.php

-
message: "#^Parameter \\#1 \\$configArray of method PhpMyAdmin\\\\UserPreferences\\:\\:save\\(\\) expects array, mixed given\\.$#"
count: 1
path: src/Controllers/Preferences/ExportController.php

-
message: "#^Parameter \\#1 \\$string of function ltrim expects string, mixed given\\.$#"
count: 1
path: src/Controllers/Preferences/ExportController.php

-
message: "#^Cannot call method getConfigArray\\(\\) on mixed\\.$#"
count: 1
path: src/Controllers/Preferences/FeaturesController.php

-
message: "#^Parameter \\#1 \\$configArray of method PhpMyAdmin\\\\UserPreferences\\:\\:save\\(\\) expects array, mixed given\\.$#"
count: 1
path: src/Controllers/Preferences/FeaturesController.php

-
message: "#^Parameter \\#1 \\$string of function ltrim expects string, mixed given\\.$#"
count: 1
path: src/Controllers/Preferences/FeaturesController.php

-
message: "#^Cannot call method getConfigArray\\(\\) on mixed\\.$#"
count: 1
path: src/Controllers/Preferences/ImportController.php

-
message: "#^Parameter \\#1 \\$configArray of method PhpMyAdmin\\\\UserPreferences\\:\\:save\\(\\) expects array, mixed given\\.$#"
count: 1
path: src/Controllers/Preferences/ImportController.php

-
message: "#^Parameter \\#1 \\$string of function ltrim expects string, mixed given\\.$#"
count: 1
path: src/Controllers/Preferences/ImportController.php

-
message: "#^Cannot call method getConfigArray\\(\\) on mixed\\.$#"
count: 1
path: src/Controllers/Preferences/MainPanelController.php

-
message: "#^Parameter \\#1 \\$configArray of method PhpMyAdmin\\\\UserPreferences\\:\\:save\\(\\) expects array, mixed given\\.$#"
count: 1
path: src/Controllers/Preferences/MainPanelController.php

-
message: "#^Parameter \\#1 \\$string of function ltrim expects string, mixed given\\.$#"
count: 1
path: src/Controllers/Preferences/MainPanelController.php

-
message: "#^Cannot call method getConfigArray\\(\\) on mixed\\.$#"
count: 2
path: src/Controllers/Preferences/ManageController.php

-
message: "#^Cannot call method getFlatDefaultConfig\\(\\) on mixed\\.$#"
count: 1
path: src/Controllers/Preferences/ManageController.php

-
message: "#^Cannot call method resetConfigData\\(\\) on mixed\\.$#"
count: 1
path: src/Controllers/Preferences/ManageController.php

-
message: "#^Only booleans are allowed in an if condition, PhpMyAdmin\\\\Message\\|string given\\.$#"
count: 1
Expand All @@ -3115,16 +3060,6 @@ parameters:
count: 1
path: src/Controllers/Preferences/ManageController.php

-
message: "#^Parameter \\#1 \\$cf of class PhpMyAdmin\\\\Config\\\\Forms\\\\User\\\\UserFormList constructor expects PhpMyAdmin\\\\Config\\\\ConfigFile, mixed given\\.$#"
count: 1
path: src/Controllers/Preferences/ManageController.php

-
message: "#^Parameter \\#1 \\$configArray of method PhpMyAdmin\\\\UserPreferences\\:\\:save\\(\\) expects array, mixed given\\.$#"
count: 1
path: src/Controllers/Preferences/ManageController.php

-
message: "#^Parameter \\#1 \\$fileName of method PhpMyAdmin\\\\UserPreferences\\:\\:redirect\\(\\) expects string, string\\|false given\\.$#"
count: 1
Expand Down Expand Up @@ -3160,46 +3095,16 @@ parameters:
count: 1
path: src/Controllers/Preferences/ManageController.php

-
message: "#^Parameter \\#1 \\.\\.\\.\\$arrays of function array_merge expects array, mixed given\\.$#"
count: 2
path: src/Controllers/Preferences/ManageController.php

-
message: "#^Parameter \\#2 \\.\\.\\.\\$arrays of function array_merge expects array, mixed given\\.$#"
count: 1
path: src/Controllers/Preferences/ManageController.php

-
message: "#^Parameter \\#3 \\$subject of function str_replace expects array\\|string, \\(int\\|string\\) given\\.$#"
count: 1
path: src/Controllers/Preferences/ManageController.php

-
message: "#^Cannot call method getConfigArray\\(\\) on mixed\\.$#"
count: 1
path: src/Controllers/Preferences/NavigationController.php

-
message: "#^Parameter \\#1 \\$configArray of method PhpMyAdmin\\\\UserPreferences\\:\\:save\\(\\) expects array, mixed given\\.$#"
count: 1
path: src/Controllers/Preferences/NavigationController.php

-
message: "#^Parameter \\#1 \\$string of function ltrim expects string, mixed given\\.$#"
count: 1
path: src/Controllers/Preferences/NavigationController.php

-
message: "#^Cannot call method getConfigArray\\(\\) on mixed\\.$#"
count: 1
path: src/Controllers/Preferences/SqlController.php

-
message: "#^Parameter \\#1 \\$configArray of method PhpMyAdmin\\\\UserPreferences\\:\\:save\\(\\) expects array, mixed given\\.$#"
count: 1
path: src/Controllers/Preferences/SqlController.php

-
message: "#^Parameter \\#1 \\$string of function ltrim expects string, mixed given\\.$#"
count: 1
Expand Down Expand Up @@ -3751,62 +3656,52 @@ parameters:
path: src/Controllers/Server/Variables/SetVariableController.php

-
message: "#^Only booleans are allowed in a ternary operator condition, mixed given\\.$#"
message: "#^Parameter \\#1 \\$filename of function file_exists expects string, mixed given\\.$#"
count: 1
path: src/Controllers/Setup/HomeController.php
path: src/Controllers/Setup/ConfigController.php

-
message: "#^Parameter \\#1 \\$id of method PhpMyAdmin\\\\Config\\\\ConfigFile\\:\\:getServerName\\(\\) expects int, \\(int\\|string\\) given\\.$#"
message: "#^Parameter \\#1 \\$filename of function file_exists expects string, mixed given\\.$#"
count: 1
path: src/Controllers/Setup/HomeController.php
path: src/Controllers/Setup/FormController.php

-
message: "#^Parameter \\#1 \\$server of method PhpMyAdmin\\\\Config\\\\ConfigFile\\:\\:getServerDSN\\(\\) expects int, \\(int\\|string\\) given\\.$#"
message: "#^Only booleans are allowed in a ternary operator condition, mixed given\\.$#"
count: 1
path: src/Controllers/Setup/HomeController.php

-
message: "#^Parameter \\#1 \\$config of class PhpMyAdmin\\\\Controllers\\\\Setup\\\\ConfigController constructor expects PhpMyAdmin\\\\Config\\\\ConfigFile, mixed given\\.$#"
count: 1
path: src/Controllers/Setup/MainController.php

-
message: "#^Parameter \\#1 \\$config of class PhpMyAdmin\\\\Controllers\\\\Setup\\\\FormController constructor expects PhpMyAdmin\\\\Config\\\\ConfigFile, mixed given\\.$#"
message: "#^Parameter \\#1 \\$filename of function file_exists expects string, mixed given\\.$#"
count: 1
path: src/Controllers/Setup/MainController.php
path: src/Controllers/Setup/HomeController.php

-
message: "#^Parameter \\#1 \\$config of class PhpMyAdmin\\\\Controllers\\\\Setup\\\\HomeController constructor expects PhpMyAdmin\\\\Config\\\\ConfigFile, mixed given\\.$#"
message: "#^Parameter \\#1 \\$id of method PhpMyAdmin\\\\Config\\\\ConfigFile\\:\\:getServerName\\(\\) expects int, \\(int\\|string\\) given\\.$#"
count: 1
path: src/Controllers/Setup/MainController.php
path: src/Controllers/Setup/HomeController.php

-
message: "#^Parameter \\#1 \\$config of class PhpMyAdmin\\\\Controllers\\\\Setup\\\\ServersController constructor expects PhpMyAdmin\\\\Config\\\\ConfigFile, mixed given\\.$#"
message: "#^Parameter \\#1 \\$server of method PhpMyAdmin\\\\Config\\\\ConfigFile\\:\\:getServerDSN\\(\\) expects int, \\(int\\|string\\) given\\.$#"
count: 1
path: src/Controllers/Setup/MainController.php
path: src/Controllers/Setup/HomeController.php

-
message: "#^Parameter \\#1 \\$filename of function file_exists expects string, mixed given\\.$#"
count: 1
path: src/Controllers/Setup/MainController.php
path: src/Controllers/Setup/ServerDestroyController.php

-
message: "#^Cannot call method resetConfigData\\(\\) on mixed\\.$#"
count: 1
path: src/Controllers/Setup/ShowConfigController.php

-
message: "#^Parameter \\#1 \\$cf of class PhpMyAdmin\\\\Config\\\\Forms\\\\Setup\\\\ConfigForm constructor expects PhpMyAdmin\\\\Config\\\\ConfigFile, mixed given\\.$#"
message: "#^Parameter \\#1 \\$filename of function file_exists expects string, mixed given\\.$#"
count: 1
path: src/Controllers/Setup/ShowConfigController.php
path: src/Controllers/Setup/ServersController.php

-
message: "#^Parameter \\#1 \\$cf of static method PhpMyAdmin\\\\Setup\\\\ConfigGenerator\\:\\:getConfigFile\\(\\) expects PhpMyAdmin\\\\Config\\\\ConfigFile, mixed given\\.$#"
message: "#^Parameter \\#1 \\$filename of function file_exists expects string, mixed given\\.$#"
count: 1
path: src/Controllers/Setup/ShowConfigController.php

-
message: "#^Parameter \\#1 \\$cf of static method PhpMyAdmin\\\\Config\\\\Validator\\:\\:validate\\(\\) expects PhpMyAdmin\\\\Config\\\\ConfigFile, mixed given\\.$#"
message: "#^Parameter \\#1 \\$filename of function file_exists expects string, mixed given\\.$#"
count: 1
path: src/Controllers/Setup/ValidateController.php

Expand Down Expand Up @@ -15230,11 +15125,6 @@ parameters:
count: 2
path: tests/unit/Config/ServerConfigChecksTest.php

-
message: "#^Parameter \\#1 \\$cfg of class PhpMyAdmin\\\\Config\\\\ServerConfigChecks constructor expects PhpMyAdmin\\\\Config\\\\ConfigFile, mixed given\\.$#"
count: 3
path: tests/unit/Config/ServerConfigChecksTest.php

-
message: "#^Property PhpMyAdmin\\\\Tests\\\\Config\\\\ServerConfigChecksTest\\:\\:\\$sessionID \\(string\\) does not accept mixed\\.$#"
count: 1
Expand Down

0 comments on commit 510e442

Please sign in to comment.