diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 8cfde8f73a..64769444c4 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -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 diff --git a/psalm-baseline.xml b/psalm-baseline.xml index def2b2b1f4..a43443b6f1 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -5592,13 +5592,6 @@ settings[$pluginType->value][$opt]]]> - - getName()]]> - getName()]]> - - - - settings[$pluginType->value][$opt])]]> @@ -7188,64 +7181,6 @@ fetchValue('SELECT @@have_profiling')]]> - - - getName()]]> - - - getName()]]> - getName()]]> - getName()]]> - - - - - getName()]]> - - - getName()]]> - - - - - getName()]]> - - - getName()]]> - getName()]]> - getName()]]> - - - - - getName()]]> - - - getName()]]> - getName()]]> - getName()]]> - - - - - getName()]]> - - - getName()]]> - getName()]]> - getName()]]> - - - - - getName()]]> - - - getName()]]> - getName()]]> - getName()]]> - - diff --git a/src/Plugins.php b/src/Plugins.php index 3f0e7f0bed..5f0edfbfa8 100644 --- a/src/Plugins.php +++ b/src/Plugins.php @@ -315,7 +315,7 @@ class Plugins } $ret .= '
    • getName() !== null) { + if ($subgroupHeader !== null && $subgroupHeader->getName() !== '') { $ret .= ' id="ul_' . $subgroupHeader->getName() . '">'; } else { $ret .= '>'; diff --git a/src/Plugins/Export/ExportSql.php b/src/Plugins/Export/ExportSql.php index 23e795a558..69794ac7ea 100644 --- a/src/Plugins/Export/ExportSql.php +++ b/src/Plugins/Export/ExportSql.php @@ -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); diff --git a/src/Properties/Options/OptionsPropertyGroup.php b/src/Properties/Options/OptionsPropertyGroup.php index 01caea1ae3..7c283c77b7 100644 --- a/src/Properties/Options/OptionsPropertyGroup.php +++ b/src/Properties/Options/OptionsPropertyGroup.php @@ -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); diff --git a/src/Properties/Options/OptionsPropertyItem.php b/src/Properties/Options/OptionsPropertyItem.php index cba3ae8f0a..0657d30946 100644 --- a/src/Properties/Options/OptionsPropertyItem.php +++ b/src/Properties/Options/OptionsPropertyItem.php @@ -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; } diff --git a/tests/unit/Properties/Options/Items/PropertyItemsTest.php b/tests/unit/Properties/Options/Items/PropertyItemsTest.php index 5f36f9d6e0..0cfab90e3c 100644 --- a/tests/unit/Properties/Options/Items/PropertyItemsTest.php +++ b/tests/unit/Properties/Options/Items/PropertyItemsTest.php @@ -14,7 +14,7 @@ class PropertyItemsTest extends AbstractTestCase { public function testBoolText(): void { - $object = new BoolPropertyItem(null, 'Text'); + $object = new BoolPropertyItem('', 'Text'); self::assertSame( 'Text',