Skip to content

Commit b759e81

Browse files
Merge pull request #19440 from MauricioFauth/ResponseRenderer-checkParameters-removal
Remove the ResponseRenderer::checkParameters() method
2 parents c29067d + b68a82e commit b759e81

42 files changed

Lines changed: 407 additions & 206 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

phpstan-baseline.neon

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2823,12 +2823,6 @@ parameters:
28232823
count: 1
28242824
path: src/Controllers/Export/ExportController.php
28252825

2826-
-
2827-
message: '#^Cannot cast mixed to string\.$#'
2828-
identifier: cast.string
2829-
count: 1
2830-
path: src/Controllers/Export/ExportController.php
2831-
28322826
-
28332827
message: '#^Construct empty\(\) is not allowed\. Use more strict comparison\.$#'
28342828
identifier: empty.notAllowed

psalm-baseline.xml

Lines changed: 221 additions & 6 deletions
Large diffs are not rendered by default.

src/Controllers/Database/DataDictionaryController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public function __construct(
3030

3131
public function __invoke(ServerRequest $request): Response
3232
{
33-
if (! $this->response->checkParameters(['db'], true)) {
34-
return $this->response->response();
33+
if (Current::$database === '') {
34+
return $this->response->missingParameterError('db');
3535
}
3636

3737
$relationParameters = $this->relation->getRelationParameters();

src/Controllers/Database/DesignerController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ public function __invoke(ServerRequest $request): Response
160160
return $this->response->response();
161161
}
162162

163-
if (! $this->response->checkParameters(['db'])) {
164-
return $this->response->response();
163+
if (Current::$database === '') {
164+
return $this->response->missingParameterError('db');
165165
}
166166

167167
$GLOBALS['errorUrl'] = Util::getScriptNameForOption(

src/Controllers/Database/EventsController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ public function __invoke(ServerRequest $request): Response
4545
$this->response->addScriptFiles(['database/events.js', 'sql.js']);
4646

4747
if (! $request->isAjax()) {
48-
if (! $this->response->checkParameters(['db'])) {
49-
return $this->response->response();
48+
if (Current::$database === '') {
49+
return $this->response->missingParameterError('db');
5050
}
5151

5252
$GLOBALS['errorUrl'] = Util::getScriptNameForOption(

src/Controllers/Database/ExportController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public function __invoke(ServerRequest $request): Response
4949

5050
$this->response->addScriptFiles(['export.js']);
5151

52-
if (! $this->response->checkParameters(['db'])) {
53-
return $this->response->response();
52+
if (Current::$database === '') {
53+
return $this->response->missingParameterError('db');
5454
}
5555

5656
$GLOBALS['errorUrl'] = Util::getScriptNameForOption(

src/Controllers/Database/ImportController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public function __invoke(ServerRequest $request): Response
4949

5050
$this->response->addScriptFiles(['import.js']);
5151

52-
if (! $this->response->checkParameters(['db'])) {
53-
return $this->response->response();
52+
if (Current::$database === '') {
53+
return $this->response->missingParameterError('db');
5454
}
5555

5656
$config = Config::getInstance();

src/Controllers/Database/RoutinesController.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ public function __invoke(ServerRequest $request): Response
6161

6262
$config = Config::getInstance();
6363
if (! $request->isAjax()) {
64+
if (Current::$database === '') {
65+
return $this->response->missingParameterError('db');
66+
}
67+
6468
/**
6569
* Displays the header and tabs
6670
*/
6771
if (Current::$table !== '' && in_array(Current::$table, $this->dbi->getTables(Current::$database), true)) {
68-
if (! $this->response->checkParameters(['db', 'table'])) {
69-
return $this->response->response();
70-
}
71-
7272
UrlParams::$params = ['db' => Current::$database, 'table' => Current::$table];
7373
$GLOBALS['errorUrl'] = Util::getScriptNameForOption($config->settings['DefaultTabTable'], 'table');
7474
$GLOBALS['errorUrl'] .= Url::getCommon(UrlParams::$params, '&');
@@ -92,10 +92,6 @@ public function __invoke(ServerRequest $request): Response
9292
} else {
9393
Current::$table = '';
9494

95-
if (! $this->response->checkParameters(['db'])) {
96-
return $this->response->response();
97-
}
98-
9995
$GLOBALS['errorUrl'] = Util::getScriptNameForOption(
10096
$config->settings['DefaultTabDatabase'],
10197
'database',

src/Controllers/Database/SearchController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public function __invoke(ServerRequest $request): Response
3939

4040
$this->response->addScriptFiles(['database/search.js', 'sql.js', 'makegrid.js']);
4141

42-
if (! $this->response->checkParameters(['db'])) {
43-
return $this->response->response();
42+
if (Current::$database === '') {
43+
return $this->response->missingParameterError('db');
4444
}
4545

4646
$config = Config::getInstance();

src/Controllers/Database/SqlController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ public function __invoke(ServerRequest $request): Response
4545
$this->response->addHTML($this->pageSettings->getErrorHTML());
4646
$this->response->addHTML($this->pageSettings->getHTML());
4747

48-
if (! $this->response->checkParameters(['db'])) {
49-
return $this->response->response();
48+
if (Current::$database === '') {
49+
return $this->response->missingParameterError('db');
5050
}
5151

5252
$GLOBALS['errorUrl'] = Util::getScriptNameForOption(

0 commit comments

Comments
 (0)