Fix SA issues

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
Kamil Tekiela 2026-02-14 17:53:32 +00:00
parent 2702f2814e
commit 49fc4c47d3
8 changed files with 9 additions and 33 deletions

View File

@ -10590,30 +10590,12 @@ parameters:
count: 1
path: src/Profiling.php
-
message: '#^Loose comparison via "\!\=" is not allowed\.$#'
identifier: notEqual.notAllowed
count: 1
path: src/Properties/Options/Items/BoolPropertyItem.php
-
message: '#^Cannot cast mixed to string\.$#'
identifier: cast.string
count: 1
path: src/Properties/Options/Items/RadioPropertyItem.php
-
message: '#^Loose comparison via "\=\=" is not allowed\.$#'
identifier: equal.notAllowed
count: 1
path: src/Properties/Options/Items/RadioPropertyItem.php
-
message: '#^Cannot cast mixed to string\.$#'
identifier: cast.string
count: 1
path: src/Properties/Options/Items/SelectPropertyItem.php
-
message: '#^Loose comparison via "\=\=" is not allowed\.$#'
identifier: equal.notAllowed

View File

@ -7235,9 +7235,6 @@
</PossiblyNullOperand>
</file>
<file src="src/Properties/Options/Items/RadioPropertyItem.php">
<MixedAssignment>
<code><![CDATA[$val]]></code>
</MixedAssignment>
<PossiblyNullOperand>
<code><![CDATA[$this->getName()]]></code>
<code><![CDATA[$this->getName()]]></code>
@ -7246,9 +7243,6 @@
</PossiblyNullOperand>
</file>
<file src="src/Properties/Options/Items/SelectPropertyItem.php">
<MixedAssignment>
<code><![CDATA[$val]]></code>
</MixedAssignment>
<PossiblyNullOperand>
<code><![CDATA[$this->getName()]]></code>
<code><![CDATA[$this->getName()]]></code>

View File

@ -77,7 +77,7 @@ abstract class SchemaPlugin implements Plugin
/**
* Returns the array of paper sizes
*
* @return mixed[] array of paper sizes
* @return string[] array of paper sizes
*/
protected function getPaperSizeArray(): array
{

View File

@ -28,7 +28,7 @@ class BoolPropertyItem extends OptionsPropertyOneItem
$pluginName . '_' . $this->getName(),
);
if ($this->getForce() != null) {
if ($this->getForce() !== null) {
$ret .= ' onclick="if (!this.checked &amp;&amp; '
. '(!document.getElementById(\'checkbox_' . $pluginName
. '_' . $this->getForce() . '\') '

View File

@ -36,7 +36,7 @@ class RadioPropertyItem extends OptionsPropertyOneItem
$ret .= '><label class="form-check-label" for="radio_' . $pluginName . '_'
. $this->getName() . '_' . $key . '">'
. $plugin->getTranslatedText((string) $val) . '</label></div>';
. $plugin->getTranslatedText($val) . '</label></div>';
}
$ret .= '</li>';

View File

@ -36,7 +36,7 @@ class SelectPropertyItem extends OptionsPropertyOneItem
$ret .= ' selected';
}
$ret .= '>' . $plugin->getTranslatedText((string) $val) . '</option>';
$ret .= '>' . $plugin->getTranslatedText($val) . '</option>';
}
$ret .= '</select>';

View File

@ -13,7 +13,7 @@ namespace PhpMyAdmin\Properties\Options;
*/
abstract class OptionsPropertyOneItem extends OptionsPropertyItem
{
/** @var mixed[] */
/** @var string[] */
private array $values = [];
/** @var string|string[] */
@ -27,7 +27,7 @@ abstract class OptionsPropertyOneItem extends OptionsPropertyItem
/**
* Gets the values
*
* @return mixed[]
* @return string[]
*/
public function getValues(): array
{
@ -37,7 +37,7 @@ abstract class OptionsPropertyOneItem extends OptionsPropertyItem
/**
* Sets the values
*
* @param mixed[] $values values
* @param string[] $values values
*/
public function setValues(array $values): void
{

View File

@ -41,10 +41,10 @@ class OptionsPropertyOneItemTest extends AbstractTestCase
*/
public function testGetSetValues(): void
{
$this->stub->setValues([1, 2]);
$this->stub->setValues(['1', '2']);
self::assertSame(
[1, 2],
['1', '2'],
$this->stub->getValues(),
);
}