Visitar URL original
Remove useless references (#18058) · phpmyadmin/phpmyadmin@2b32209 · GitHub
Skip to content

Commit 2b32209

Browse files
Remove useless references (#18058)
* Remove useless references * Change out param to returning * Add missing type declarations * Update psalm-baseline.xml --------- Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
1 parent 3a56e51 commit 2b32209

2 files changed

Lines changed: 12 additions & 27 deletions

File tree

‎libraries/classes/Config/PageSettings.php‎

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function __construct($formGroupName, $elemId = null)
8282
// Process form
8383
$error = null;
8484
if (isset($_POST['submit_save']) && $_POST['submit_save'] == $formGroupName) {
85-
$this->processPageSettings($formDisplay, $cf, $error);
85+
$error = $this->processPageSettings($formDisplay, $cf);
8686
}
8787

8888
// Display forms
@@ -92,14 +92,13 @@ public function __construct($formGroupName, $elemId = null)
9292
/**
9393
* Process response to form
9494
*
95-
* @param FormDisplay $formDisplay Form
96-
* @param ConfigFile $cf Configuration file
97-
* @param Message|null $error Error message
95+
* @param FormDisplay $formDisplay Form
96+
* @param ConfigFile $cf Configuration file
9897
*/
99-
private function processPageSettings(&$formDisplay, &$cf, &$error): void
98+
private function processPageSettings(FormDisplay $formDisplay, ConfigFile $cf): ?Message
10099
{
101100
if (! $formDisplay->process(false) || $formDisplay->hasErrors()) {
102-
return;
101+
return null;
103102
}
104103

105104
// save settings
@@ -111,7 +110,7 @@ private function processPageSettings(&$formDisplay, &$cf, &$error): void
111110
exit;
112111
}
113112

114-
$error = $result;
113+
return $result;
115114
}
116115

117116
/**
@@ -120,7 +119,7 @@ private function processPageSettings(&$formDisplay, &$cf, &$error): void
120119
* @param FormDisplay $formDisplay Form
121120
* @param Message|null $error Error message
122121
*/
123-
private function storeError(&$formDisplay, &$error): void
122+
private function storeError(FormDisplay $formDisplay, ?Message $error): void
124123
{
125124
$retval = '';
126125
if ($error) {
@@ -141,12 +140,10 @@ private function storeError(&$formDisplay, &$error): void
141140
/**
142141
* Display page-related settings
143142
*
144-
* @param FormDisplay $formDisplay Form
145-
* @param Message $error Error message
146-
*
147-
* @return string
143+
* @param FormDisplay $formDisplay Form
144+
* @param Message|null $error Error message
148145
*/
149-
private function getPageSettingsDisplay(&$formDisplay, &$error)
146+
private function getPageSettingsDisplay(FormDisplay $formDisplay, ?Message $error): string
150147
{
151148
$response = ResponseRenderer::getInstance();
152149

@@ -165,20 +162,16 @@ private function getPageSettingsDisplay(&$formDisplay, &$error)
165162

166163
/**
167164
* Get HTML output
168-
*
169-
* @return string
170165
*/
171-
public function getHTML()
166+
public function getHTML(): string
172167
{
173168
return $this->HTML;
174169
}
175170

176171
/**
177172
* Get error HTML output
178-
*
179-
* @return string
180173
*/
181-
public function getErrorHTML()
174+
public function getErrorHTML(): string
182175
{
183176
return $this->errorHTML;
184177
}

‎psalm-baseline.xml‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -644,14 +644,6 @@
644644
<code>$result['Sql_queries'][]</code>
645645
</MixedArrayAssignment>
646646
</file>
647-
<file src="libraries/classes/Config/PageSettings.php">
648-
<PossiblyNullArgument occurrences="1">
649-
<code>$error</code>
650-
</PossiblyNullArgument>
651-
<ReferenceConstraintViolation occurrences="1">
652-
<code>return $retval;</code>
653-
</ReferenceConstraintViolation>
654-
</file>
655647
<file src="libraries/classes/Config/ServerConfigChecks.php">
656648
<MixedAssignment occurrences="1">
657649
<code>$loginCookieValidity</code>

0 commit comments

Comments
 (0)