Remove nullability from $name
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
parent
3cbba7d341
commit
788662ae0c
@ -10539,54 +10539,18 @@ parameters:
|
||||
count: 1
|
||||
path: src/Profiling.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#2 \$opt of static method PhpMyAdmin\\Plugins\:\:checkboxCheck\(\) expects string, string\|null given\.$#'
|
||||
identifier: argument.type
|
||||
count: 1
|
||||
path: src/Properties/Options/Items/BoolPropertyItem.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#2 \$opt of static method PhpMyAdmin\\Plugins\:\:getDefault\(\) expects string, string\|null given\.$#'
|
||||
identifier: argument.type
|
||||
count: 1
|
||||
path: src/Properties/Options/Items/HiddenPropertyItem.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#2 \$opt of static method PhpMyAdmin\\Plugins\:\:getDefault\(\) expects string, string\|null given\.$#'
|
||||
identifier: argument.type
|
||||
count: 1
|
||||
path: src/Properties/Options/Items/NumberPropertyItem.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison via "\=\=" is not allowed\.$#'
|
||||
identifier: equal.notAllowed
|
||||
count: 1
|
||||
path: src/Properties/Options/Items/RadioPropertyItem.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#2 \$opt of static method PhpMyAdmin\\Plugins\:\:getDefault\(\) expects string, string\|null given\.$#'
|
||||
identifier: argument.type
|
||||
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/SelectPropertyItem.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#2 \$opt of static method PhpMyAdmin\\Plugins\:\:getDefault\(\) expects string, string\|null given\.$#'
|
||||
identifier: argument.type
|
||||
count: 1
|
||||
path: src/Properties/Options/Items/SelectPropertyItem.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#2 \$opt of static method PhpMyAdmin\\Plugins\:\:getDefault\(\) expects string, string\|null given\.$#'
|
||||
identifier: argument.type
|
||||
count: 1
|
||||
path: src/Properties/Options/Items/TextPropertyItem.php
|
||||
|
||||
-
|
||||
message: '#^Loose comparison via "\=\=" is not allowed\.$#'
|
||||
identifier: equal.notAllowed
|
||||
|
||||
@ -5592,13 +5592,6 @@
|
||||
<PossiblyInvalidCast>
|
||||
<code><![CDATA[$config->settings[$pluginType->value][$opt]]]></code>
|
||||
</PossiblyInvalidCast>
|
||||
<PossiblyNullOperand>
|
||||
<code><![CDATA[$propertyGroup->getName()]]></code>
|
||||
<code><![CDATA[$subgroupHeader->getName()]]></code>
|
||||
</PossiblyNullOperand>
|
||||
<PossiblyNullReference>
|
||||
<code><![CDATA[getName]]></code>
|
||||
</PossiblyNullReference>
|
||||
<RiskyTruthyFalsyComparison>
|
||||
<code><![CDATA[empty(Config::getInstance()->settings[$pluginType->value][$opt])]]></code>
|
||||
</RiskyTruthyFalsyComparison>
|
||||
@ -7188,64 +7181,6 @@
|
||||
<code><![CDATA[$dbi->fetchValue('SELECT @@have_profiling')]]></code>
|
||||
</RiskyTruthyFalsyComparison>
|
||||
</file>
|
||||
<file src="src/Properties/Options/Items/BoolPropertyItem.php">
|
||||
<PossiblyNullArgument>
|
||||
<code><![CDATA[$this->getName()]]></code>
|
||||
</PossiblyNullArgument>
|
||||
<PossiblyNullOperand>
|
||||
<code><![CDATA[$this->getName()]]></code>
|
||||
<code><![CDATA[$this->getName()]]></code>
|
||||
<code><![CDATA[$this->getName()]]></code>
|
||||
</PossiblyNullOperand>
|
||||
</file>
|
||||
<file src="src/Properties/Options/Items/HiddenPropertyItem.php">
|
||||
<PossiblyNullArgument>
|
||||
<code><![CDATA[$this->getName()]]></code>
|
||||
</PossiblyNullArgument>
|
||||
<PossiblyNullOperand>
|
||||
<code><![CDATA[$this->getName()]]></code>
|
||||
</PossiblyNullOperand>
|
||||
</file>
|
||||
<file src="src/Properties/Options/Items/NumberPropertyItem.php">
|
||||
<PossiblyNullArgument>
|
||||
<code><![CDATA[$this->getName()]]></code>
|
||||
</PossiblyNullArgument>
|
||||
<PossiblyNullOperand>
|
||||
<code><![CDATA[$this->getName()]]></code>
|
||||
<code><![CDATA[$this->getName()]]></code>
|
||||
<code><![CDATA[$this->getName()]]></code>
|
||||
</PossiblyNullOperand>
|
||||
</file>
|
||||
<file src="src/Properties/Options/Items/RadioPropertyItem.php">
|
||||
<PossiblyNullArgument>
|
||||
<code><![CDATA[$this->getName()]]></code>
|
||||
</PossiblyNullArgument>
|
||||
<PossiblyNullOperand>
|
||||
<code><![CDATA[$this->getName()]]></code>
|
||||
<code><![CDATA[$this->getName()]]></code>
|
||||
<code><![CDATA[$this->getName()]]></code>
|
||||
</PossiblyNullOperand>
|
||||
</file>
|
||||
<file src="src/Properties/Options/Items/SelectPropertyItem.php">
|
||||
<PossiblyNullArgument>
|
||||
<code><![CDATA[$this->getName()]]></code>
|
||||
</PossiblyNullArgument>
|
||||
<PossiblyNullOperand>
|
||||
<code><![CDATA[$this->getName()]]></code>
|
||||
<code><![CDATA[$this->getName()]]></code>
|
||||
<code><![CDATA[$this->getName()]]></code>
|
||||
</PossiblyNullOperand>
|
||||
</file>
|
||||
<file src="src/Properties/Options/Items/TextPropertyItem.php">
|
||||
<PossiblyNullArgument>
|
||||
<code><![CDATA[$this->getName()]]></code>
|
||||
</PossiblyNullArgument>
|
||||
<PossiblyNullOperand>
|
||||
<code><![CDATA[$this->getName()]]></code>
|
||||
<code><![CDATA[$this->getName()]]></code>
|
||||
<code><![CDATA[$this->getName()]]></code>
|
||||
</PossiblyNullOperand>
|
||||
</file>
|
||||
<file src="src/Query/Compatibility.php">
|
||||
<PossiblyInvalidArgument>
|
||||
<code><![CDATA[$eachTables[$tableName]['Comment'] ?? '']]></code>
|
||||
|
||||
@ -315,7 +315,7 @@ class Plugins
|
||||
}
|
||||
|
||||
$ret .= '<li class="list-group-item"><ul class="list-group"';
|
||||
if ($subgroupHeader?->getName() !== null) {
|
||||
if ($subgroupHeader !== null && $subgroupHeader->getName() !== '') {
|
||||
$ret .= ' id="ul_' . $subgroupHeader->getName() . '">';
|
||||
} else {
|
||||
$ret .= '>';
|
||||
|
||||
@ -459,7 +459,7 @@ class ExportSql extends ExportPlugin
|
||||
/* Syntax to use when inserting data */
|
||||
$subgroup = new OptionsPropertySubgroup();
|
||||
$leaf = new MessageOnlyPropertyItem(
|
||||
null,
|
||||
'',
|
||||
__('Syntax to use when inserting data:'),
|
||||
);
|
||||
$subgroup->setSubgroupHeader($leaf);
|
||||
|
||||
@ -25,7 +25,7 @@ abstract class OptionsPropertyGroup extends OptionsPropertyItem implements Count
|
||||
*/
|
||||
private SplObjectStorage $properties;
|
||||
|
||||
public function __construct(string|null $name = null, string $text = '')
|
||||
public function __construct(string $name = '', string $text = '')
|
||||
{
|
||||
parent::__construct($name, $text);
|
||||
|
||||
|
||||
@ -15,11 +15,11 @@ namespace PhpMyAdmin\Properties\Options;
|
||||
*/
|
||||
abstract class OptionsPropertyItem
|
||||
{
|
||||
public function __construct(private readonly string|null $name = null, private readonly string $text = '')
|
||||
public function __construct(private readonly string $name = '', private readonly string $text = '')
|
||||
{
|
||||
}
|
||||
|
||||
public function getName(): string|null
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ class PropertyItemsTest extends AbstractTestCase
|
||||
{
|
||||
public function testBoolText(): void
|
||||
{
|
||||
$object = new BoolPropertyItem(null, 'Text');
|
||||
$object = new BoolPropertyItem('', 'Text');
|
||||
|
||||
self::assertSame(
|
||||
'Text',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user