From 4e90e1efa9fc0281b752085be5ff234ca46d54ef Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Sat, 14 Feb 2026 16:06:56 +0000 Subject: [PATCH 01/11] Use assertCount Signed-off-by: Kamil Tekiela --- phpstan-baseline.neon | 6 ------ tests/unit/Properties/Options/OptionsPropertyGroupTest.php | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 798c54529e..dc525d5357 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -16467,12 +16467,6 @@ parameters: count: 1 path: tests/unit/PluginsTest.php - - - message: '#^You should use assertCount\(\$expectedCount, \$variable\) instead of assertSame\(\$expectedCount, \$variable\-\>count\(\)\)\.$#' - identifier: phpunit.assertCount - count: 1 - path: tests/unit/Properties/Options/OptionsPropertyGroupTest.php - - message: ''' #^Call to deprecated method getInstance\(\) of class PhpMyAdmin\\Config\: diff --git a/tests/unit/Properties/Options/OptionsPropertyGroupTest.php b/tests/unit/Properties/Options/OptionsPropertyGroupTest.php index 418d9ffd8c..4e77eb407c 100644 --- a/tests/unit/Properties/Options/OptionsPropertyGroupTest.php +++ b/tests/unit/Properties/Options/OptionsPropertyGroupTest.php @@ -71,6 +71,6 @@ class OptionsPropertyGroupTest extends AbstractTestCase $this->stub->addProperty($propertyItem); $propertyItem2 = new BoolPropertyItem(); $this->stub->addProperty($propertyItem2); - self::assertSame(2, $this->stub->count()); + self::assertCount(2, $this->stub); } } From 2e8ba5bfba6b2426dae00ea850514c2144e6e813 Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Sat, 14 Feb 2026 16:12:18 +0000 Subject: [PATCH 02/11] Delete DocPropertyItem class It was never implemented. Signed-off-by: Kamil Tekiela --- src/Plugins.php | 4 ---- src/Properties/Options/Items/DocPropertyItem.php | 14 -------------- 2 files changed, 18 deletions(-) delete mode 100644 src/Properties/Options/Items/DocPropertyItem.php diff --git a/src/Plugins.php b/src/Plugins.php index c4b98f734c..38fbe10847 100644 --- a/src/Plugins.php +++ b/src/Plugins.php @@ -20,7 +20,6 @@ use PhpMyAdmin\Plugins\SchemaPlugin; use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyMainGroup; use PhpMyAdmin\Properties\Options\Groups\OptionsPropertySubgroup; use PhpMyAdmin\Properties\Options\Items\BoolPropertyItem; -use PhpMyAdmin\Properties\Options\Items\DocPropertyItem; use PhpMyAdmin\Properties\Options\Items\HiddenPropertyItem; use PhpMyAdmin\Properties\Options\Items\MessageOnlyPropertyItem; use PhpMyAdmin\Properties\Options\Items\NumberPropertyItem; @@ -436,9 +435,6 @@ class Plugins . $propertyItem->getName() . '">' . $plugin->getTranslatedText($propertyItem->getText() ?? '') . ''; break; - case DocPropertyItem::class: - echo DocPropertyItem::class; - break; case HiddenPropertyItem::class: $ret .= '
  • Date: Sat, 14 Feb 2026 16:13:36 +0000 Subject: [PATCH 03/11] Remove temporary variable Signed-off-by: Kamil Tekiela --- src/Plugins.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Plugins.php b/src/Plugins.php index 38fbe10847..996c306f16 100644 --- a/src/Plugins.php +++ b/src/Plugins.php @@ -404,8 +404,7 @@ class Plugins OptionsPropertyItem $propertyItem, ): string { $ret = ''; - $propertyClass = $propertyItem::class; - switch ($propertyClass) { + switch ($propertyItem::class) { case BoolPropertyItem::class: $ret .= '
  • ' . "\n"; $ret .= '
    ' . "\n"; From 7b9034ee6c48c044d279bc50f9f9c57b8243d754 Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Sat, 14 Feb 2026 16:53:58 +0000 Subject: [PATCH 04/11] Fix documentation link Signed-off-by: Kamil Tekiela --- psalm-baseline.xml | 5 ++ src/Plugins.php | 55 ++++++++++---------- src/Plugins/Export/ExportSql.php | 10 ++-- src/Plugins/Import/ImportSql.php | 4 +- src/Util.php | 3 +- tests/unit/PluginsTest.php | 86 ++++++++++++++++---------------- 6 files changed, 82 insertions(+), 81 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index d715766fae..d7ab70338e 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -5644,6 +5644,11 @@ settings[$section][$opt])]]> + + + + + diff --git a/src/Plugins.php b/src/Plugins.php index 996c306f16..3d951a68df 100644 --- a/src/Plugins.php +++ b/src/Plugins.php @@ -36,8 +36,6 @@ use function __; use function class_exists; use function count; use function htmlspecialchars; -use function in_array; -use function is_array; use function is_string; use function is_subclass_of; use function mb_strtolower; @@ -324,10 +322,8 @@ class Plugins } } - $propertyClass = null; if ($properties !== null) { foreach ($properties as $propertyItem) { - $propertyClass = $propertyItem::class; // if the property is a subgroup, we deal with it recursively if ($propertyItem instanceof OptionsPropertySubgroup) { // for subgroups @@ -361,31 +357,6 @@ class Plugins $ret .= '
    '; } - if ($propertyGroup instanceof OptionsPropertyOneItem) { - $doc = $propertyGroup->getDoc(); - if (is_array($doc)) { - if (count($doc) === 3) { - $ret .= MySQLDocumentation::show($doc[1], false, null, null, $doc[2]); - } elseif (count($doc) === 1) { - $ret .= MySQLDocumentation::showDocumentation('faq', $doc[0]); - } else { - $ret .= MySQLDocumentation::show($doc[1]); - } - } - } - - // Close the list element after $doc link is displayed - if ( - in_array($propertyClass, [ - BoolPropertyItem::class, - MessageOnlyPropertyItem::class, - SelectPropertyItem::class, - TextPropertyItem::class, - ], true) - ) { - $ret .= '
  • '; - } - return $ret . "\n"; } @@ -433,6 +404,8 @@ class Plugins $ret .= ''; + $ret .= self::getDocumentationLinkHtml($propertyItem); + $ret .= ''; break; case HiddenPropertyItem::class: $ret .= '
  • ' . "\n"; $ret .= $plugin->getTranslatedText($propertyItem->getText() ?? ''); + $ret .= self::getDocumentationLinkHtml($propertyItem); + $ret .= '
  • '; break; case RadioPropertyItem::class: /** @var RadioPropertyItem $pitem */ @@ -501,6 +476,8 @@ class Plugins } $ret .= ''; + $ret .= self::getDocumentationLinkHtml($propertyItem); + $ret .= ''; break; case TextPropertyItem::class: /** @var TextPropertyItem $pitem */ @@ -525,6 +502,8 @@ class Plugins ? ' maxlength="' . $pitem->getLen() . '"' : '') . '>'; + $ret .= self::getDocumentationLinkHtml($propertyItem); + $ret .= ''; break; case NumberPropertyItem::class: $ret .= '
  • ' . "\n"; @@ -600,4 +579,22 @@ class Plugins return $ret; } + + public static function getDocumentationLinkHtml(OptionsPropertyOneItem $propertyGroup): string + { + $doc = $propertyGroup->getDoc(); + if ($doc === '') { + return ''; + } + + if (is_string($doc)) { + return MySQLDocumentation::showDocumentation('faq', $doc); + } + + if (count($doc) === 2) { + return MySQLDocumentation::show($doc[0], anchor: $doc[1]); + } + + return MySQLDocumentation::show($doc[0]); + } } diff --git a/src/Plugins/Export/ExportSql.php b/src/Plugins/Export/ExportSql.php index c346f6c5fa..e358d04816 100644 --- a/src/Plugins/Export/ExportSql.php +++ b/src/Plugins/Export/ExportSql.php @@ -223,7 +223,7 @@ class ExportSql extends ExportPlugin __('Enclose export in a transaction'), ); $leaf->setDoc( - ['programs', 'mysqldump', 'option_mysqldump_single-transaction'], + ['mysqldump', 'option_mysqldump_single-transaction'], ); $generalOptions->addProperty($leaf); @@ -233,7 +233,7 @@ class ExportSql extends ExportPlugin __('Disable foreign key checks'), ); $leaf->setDoc( - ['manual_MySQL_Database_Administration', 'server-system-variables', 'sysvar_foreign_key_checks'], + ['server-system-variables', 'sysvar_foreign_key_checks'], ); $generalOptions->addProperty($leaf); @@ -433,7 +433,7 @@ class ExportSql extends ExportPlugin __('INSERT DELAYED statements'), ); $leaf->setDoc( - ['manual_MySQL_Database_Administration', 'insert_delayed'], + ['insert_delayed'], ); $subgroup->addProperty($leaf); @@ -442,7 +442,7 @@ class ExportSql extends ExportPlugin __('INSERT IGNORE statements'), ); $leaf->setDoc( - ['manual_MySQL_Database_Administration', 'insert'], + ['insert'], ); $subgroup->addProperty($leaf); $dataOptions->addProperty($subgroup); @@ -2572,7 +2572,7 @@ class ExportSql extends ExportPlugin ); $leaf->setValues($values); $leaf->setDoc( - ['manual_MySQL_Database_Administration', 'Server_SQL_mode'], + ['sql-mode'], ); $generalOptions->addProperty($leaf); } diff --git a/src/Plugins/Import/ImportSql.php b/src/Plugins/Import/ImportSql.php index 899daf5735..b862317ac0 100644 --- a/src/Plugins/Import/ImportSql.php +++ b/src/Plugins/Import/ImportSql.php @@ -63,7 +63,7 @@ class ImportSql extends ImportPlugin ); $leaf->setValues($values); $leaf->setDoc( - ['manual_MySQL_Database_Administration', 'Server_SQL_mode'], + ['sql-mode'], ); $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( @@ -71,7 +71,7 @@ class ImportSql extends ImportPlugin __('Do not use AUTO_INCREMENT for zero values'), ); $leaf->setDoc( - ['manual_MySQL_Database_Administration', 'Server_SQL_mode', 'sqlmode_no_auto_value_on_zero'], + ['sql-mode', 'sqlmode_no_auto_value_on_zero'], ); $generalOptions->addProperty($leaf); diff --git a/src/Util.php b/src/Util.php index 3196f93bfe..e22ce62108 100644 --- a/src/Util.php +++ b/src/Util.php @@ -193,8 +193,7 @@ class Util } } - $url = 'https://dev.mysql.com/doc/refman/' - . $mysql . '/' . $lang . '/' . $link . '.html'; + $url = 'https://dev.mysql.com/doc/refman/' . $mysql . '/' . $lang . '/' . $link . '.html'; if ($anchor !== '') { $url .= '#' . $anchor; } diff --git a/tests/unit/PluginsTest.php b/tests/unit/PluginsTest.php index 24212b307f..009102b199 100644 --- a/tests/unit/PluginsTest.php +++ b/tests/unit/PluginsTest.php @@ -167,7 +167,7 @@ class PluginsTest extends AbstractTestCase
  • -
  • +

    CSV using LOAD DATA

    @@ -182,7 +182,7 @@ class PluginsTest extends AbstractTestCase
  • -
  • +

    ESRI Shape File

    This format has no options

    @@ -198,14 +198,14 @@ class PluginsTest extends AbstractTestCase
  • -
  • +

    SQL

    • -
    • + Documentation
    • -
    +
    Documentation

    XML

    This format has no options

    @@ -227,7 +227,7 @@ class PluginsTest extends AbstractTestCase $expected = <<<'HTML'

    CodeGen

    • -
    +

    CSV

    @@ -258,30 +258,30 @@ class PluginsTest extends AbstractTestCase
  • -
  • +

    LaTeX

    • -
    +
    Dump table
    Object creation options
    • -
    • -
    • -
    • + Documentation
    • + Documentation
    • + Documentation
    • -
    +
    Data dump options
    • -
    • -
    • -
    • -
    + Documentation
  • + Documentation
  • + Documentation
  • +

    MediaWiki Table

    @@ -293,7 +293,7 @@ class PluginsTest extends AbstractTestCase
  • -
  • +

    Microsoft Word 2000

    @@ -302,7 +302,7 @@ class PluginsTest extends AbstractTestCase
    Data dump options
    • -
    +

    OpenDocument Spreadsheet

    @@ -317,17 +317,17 @@ class PluginsTest extends AbstractTestCase
    Object creation options
    • -
    +
    Data dump options
    • -
    +

    PDF

    • -
    +
    Dump table
    @@ -340,22 +340,22 @@ class PluginsTest extends AbstractTestCase
    • -
    • +
    • -
  • +
  • -
  • + Documentation
  • -
  • + Documentation
  • - + Documentation
  • @@ -363,24 +363,24 @@ class PluginsTest extends AbstractTestCase
    Object creation options
    • - Add statements:
    • + Add statements:
      • -
      • +
    • -
  • +
  • -
  • +
    • @@ -388,31 +388,31 @@ class PluginsTest extends AbstractTestCase
    • -
  • +
  • -
  • +
  • -
  • +
    Data creation options
    • -
    • +
      • -
      • +
    Documentation
  • -
  • + Documentation
  • - Syntax to use when inserting data:
  • + Syntax to use when inserting data:
  • @@ -420,7 +420,7 @@ class PluginsTest extends AbstractTestCase
  • -
  • +

    Texy! text

    @@ -429,7 +429,7 @@ class PluginsTest extends AbstractTestCase
    Data dump options
    • -
    +

    TOON

    @@ -463,7 +463,7 @@ class PluginsTest extends AbstractTestCase
  • -
  • +

    EPS

    @@ -474,7 +474,7 @@ class PluginsTest extends AbstractTestCase
  • -
  • +

    PDF

    @@ -491,7 +491,7 @@ class PluginsTest extends AbstractTestCase
  • -
  • +

    SVG

    @@ -501,7 +501,7 @@ class PluginsTest extends AbstractTestCase
  • -
  • + From b2096579f1760288993aeddfb1662f915cfcee48 Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Sat, 14 Feb 2026 17:07:02 +0000 Subject: [PATCH 05/11] Remove old comment This became outdated soon after it was added 20 years ago. Signed-off-by: Kamil Tekiela --- src/Plugins.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Plugins.php b/src/Plugins.php index 3d951a68df..d602f6f807 100644 --- a/src/Plugins.php +++ b/src/Plugins.php @@ -390,7 +390,6 @@ class Plugins ); if ($propertyItem->getForce() != null) { - // Same code is also few lines lower, update both if needed $ret .= ' onclick="if (!this.checked && ' . '(!document.getElementById(\'checkbox_' . $pluginName . '_' . $propertyItem->getForce() . '\') ' From 786c683d2d5a6527a4bf615270312ce105373c95 Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Sat, 14 Feb 2026 17:31:23 +0000 Subject: [PATCH 06/11] Move HTML code to their respective classes Used Claude Sonnet 4 to move the code. Signed-off-by: Kamil Tekiela --- phpstan-baseline.neon | 84 +++++++-- psalm-baseline.xml | 111 ++++++++---- src/Plugins.php | 163 ++---------------- .../Options/Items/BoolPropertyItem.php | 34 ++++ .../Options/Items/HiddenPropertyItem.php | 15 ++ .../Options/Items/MessageOnlyPropertyItem.php | 10 ++ .../Options/Items/NumberPropertyItem.php | 24 +++ .../Options/Items/RadioPropertyItem.php | 31 ++++ .../Options/Items/SelectPropertyItem.php | 32 ++++ .../Options/Items/TextPropertyItem.php | 30 ++++ 10 files changed, 330 insertions(+), 204 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index dc525d5357..8bb0f61768 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -8310,30 +8310,12 @@ parameters: count: 1 path: src/Plugins.php - - - message: '#^Cannot cast mixed to string\.$#' - identifier: cast.string - count: 2 - path: src/Plugins.php - - message: '#^Construct empty\(\) is not allowed\. Use more strict comparison\.$#' identifier: empty.notAllowed count: 1 path: src/Plugins.php - - - message: '#^Loose comparison via "\!\=" is not allowed\.$#' - identifier: notEqual.notAllowed - count: 1 - path: src/Plugins.php - - - - message: '#^Loose comparison via "\=\=" is not allowed\.$#' - identifier: equal.notAllowed - count: 2 - path: src/Plugins.php - - message: ''' #^Call to deprecated method getInstance\(\) of class PhpMyAdmin\\Config\: @@ -10608,6 +10590,72 @@ 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: '#^Parameter \#1 \$section of static method PhpMyAdmin\\Plugins\:\:checkboxCheck\(\) expects ''Export''\|''Import''\|''Schema'', string given\.$#' + identifier: argument.type + count: 1 + path: src/Properties/Options/Items/BoolPropertyItem.php + + - + message: '#^Parameter \#1 \$section of static method PhpMyAdmin\\Plugins\:\:getDefault\(\) expects ''Export''\|''Import''\|''Schema'', string given\.$#' + identifier: argument.type + count: 1 + path: src/Properties/Options/Items/HiddenPropertyItem.php + + - + message: '#^Parameter \#1 \$section of static method PhpMyAdmin\\Plugins\:\:getDefault\(\) expects ''Export''\|''Import''\|''Schema'', string given\.$#' + identifier: argument.type + count: 1 + path: src/Properties/Options/Items/NumberPropertyItem.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: '#^Parameter \#1 \$section of static method PhpMyAdmin\\Plugins\:\:getDefault\(\) expects ''Export''\|''Import''\|''Schema'', string given\.$#' + identifier: argument.type + 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 + count: 1 + path: src/Properties/Options/Items/SelectPropertyItem.php + + - + message: '#^Parameter \#1 \$section of static method PhpMyAdmin\\Plugins\:\:getDefault\(\) expects ''Export''\|''Import''\|''Schema'', string given\.$#' + identifier: argument.type + count: 1 + path: src/Properties/Options/Items/SelectPropertyItem.php + + - + message: '#^Parameter \#1 \$section of static method PhpMyAdmin\\Plugins\:\:getDefault\(\) expects ''Export''\|''Import''\|''Schema'', string 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 d7ab70338e..c5ed60753d 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -5606,49 +5606,16 @@ - - - - settings[$section][$opt]]]> - getName()]]> - getName()]]> - getName()]]> - getName()]]> - getName()]]> - getName()]]> - getName()]]> - getName()]]> - getName()]]> - getName()]]> - getName()]]> - getName()]]> getName()]]> - getForce()]]> - getForce()]]> - getName()]]> - getName()]]> - getName()]]> - getName()]]> - getName()]]> - getName()]]> - getName()]]> - getName()]]> - getName()]]> - getName()]]> getName()]]> settings[$section][$opt])]]> - - - - - @@ -7237,6 +7204,84 @@ fetchValue('SELECT @@have_profiling')]]> + + + + + + getForce()]]> + getForce()]]> + 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 d602f6f807..0ee81fa5d1 100644 --- a/src/Plugins.php +++ b/src/Plugins.php @@ -35,7 +35,6 @@ use Throwable; use function __; use function class_exists; use function count; -use function htmlspecialchars; use function is_string; use function is_subclass_of; use function mb_strtolower; @@ -374,158 +373,16 @@ class Plugins string $pluginName, OptionsPropertyItem $propertyItem, ): string { - $ret = ''; - switch ($propertyItem::class) { - case BoolPropertyItem::class: - $ret .= '
  • ' . "\n"; - $ret .= '
    ' . "\n"; - $ret .= 'getName(), - ); - - if ($propertyItem->getForce() != null) { - $ret .= ' onclick="if (!this.checked && ' - . '(!document.getElementById(\'checkbox_' . $pluginName - . '_' . $propertyItem->getForce() . '\') ' - . '|| !document.getElementById(\'checkbox_' - . $pluginName . '_' . $propertyItem->getForce() - . '\').checked)) ' - . 'return false; else return true;"'; - } - - $ret .= '>'; - $ret .= '
    '; - $ret .= self::getDocumentationLinkHtml($propertyItem); - $ret .= '
  • '; - break; - case HiddenPropertyItem::class: - $ret .= '
  • '; - break; - case MessageOnlyPropertyItem::class: - $ret .= '
  • ' . "\n"; - $ret .= $plugin->getTranslatedText($propertyItem->getText() ?? ''); - $ret .= self::getDocumentationLinkHtml($propertyItem); - $ret .= '
  • '; - break; - case RadioPropertyItem::class: - /** @var RadioPropertyItem $pitem */ - $pitem = $propertyItem; - - $default = htmlspecialchars($plugin->getTranslatedText(self::getDefault( - $section, - $pluginName . '_' . $pitem->getName(), - ))); - - $ret .= '
  • '; - - foreach ($pitem->getValues() as $key => $val) { - $ret .= '
    getName() . '_' . $key . '">' - . $plugin->getTranslatedText((string) $val) . '
    '; - } - - $ret .= '
  • '; - - break; - case SelectPropertyItem::class: - /** @var SelectPropertyItem $pitem */ - $pitem = $propertyItem; - $ret .= '
  • ' . "\n"; - $ret .= ''; - $ret .= ''; - $ret .= self::getDocumentationLinkHtml($propertyItem); - $ret .= '
  • '; - break; - case TextPropertyItem::class: - /** @var TextPropertyItem $pitem */ - $pitem = $propertyItem; - $ret .= '
  • ' . "\n"; - $ret .= ''; - $ret .= 'getSize() !== 0 - ? ' size="' . $pitem->getSize() . '"' - : '') - . ($pitem->getLen() !== 0 - ? ' maxlength="' . $pitem->getLen() . '"' - : '') - . '>'; - $ret .= self::getDocumentationLinkHtml($propertyItem); - $ret .= '
  • '; - break; - case NumberPropertyItem::class: - $ret .= '
  • ' . "\n"; - $ret .= ''; - $ret .= ''; - break; - default: - break; - } - - return $ret; + return match (true) { + $propertyItem instanceof BoolPropertyItem => $propertyItem->getHtml($plugin, $section, $pluginName), + $propertyItem instanceof HiddenPropertyItem => $propertyItem->getHtml($plugin, $section, $pluginName), + $propertyItem instanceof MessageOnlyPropertyItem => $propertyItem->getHtml($plugin, $section, $pluginName), + $propertyItem instanceof RadioPropertyItem => $propertyItem->getHtml($plugin, $section, $pluginName), + $propertyItem instanceof SelectPropertyItem => $propertyItem->getHtml($plugin, $section, $pluginName), + $propertyItem instanceof TextPropertyItem => $propertyItem->getHtml($plugin, $section, $pluginName), + $propertyItem instanceof NumberPropertyItem => $propertyItem->getHtml($plugin, $section, $pluginName), + default => '', + }; } /** diff --git a/src/Properties/Options/Items/BoolPropertyItem.php b/src/Properties/Options/Items/BoolPropertyItem.php index ad04cc8ff4..c0caeb1733 100644 --- a/src/Properties/Options/Items/BoolPropertyItem.php +++ b/src/Properties/Options/Items/BoolPropertyItem.php @@ -4,6 +4,8 @@ declare(strict_types=1); namespace PhpMyAdmin\Properties\Options\Items; +use PhpMyAdmin\Plugins; +use PhpMyAdmin\Plugins\Plugin; use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem; /** @@ -11,4 +13,36 @@ use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem; */ class BoolPropertyItem extends OptionsPropertyOneItem { + public function getHtml(Plugin $plugin, string $section, string $pluginName): string + { + $ret = '
  • ' . "\n"; + $ret .= '
    ' . "\n"; + $ret .= 'getName(), + ); + + if ($this->getForce() != null) { + $ret .= ' onclick="if (!this.checked && ' + . '(!document.getElementById(\'checkbox_' . $pluginName + . '_' . $this->getForce() . '\') ' + . '|| !document.getElementById(\'checkbox_' + . $pluginName . '_' . $this->getForce() + . '\').checked)) ' + . 'return false; else return true;"'; + } + + $ret .= '>'; + $ret .= '
    '; + $ret .= Plugins::getDocumentationLinkHtml($this); + + return $ret; + } } diff --git a/src/Properties/Options/Items/HiddenPropertyItem.php b/src/Properties/Options/Items/HiddenPropertyItem.php index 6620d451fb..21492ac6b5 100644 --- a/src/Properties/Options/Items/HiddenPropertyItem.php +++ b/src/Properties/Options/Items/HiddenPropertyItem.php @@ -4,11 +4,26 @@ declare(strict_types=1); namespace PhpMyAdmin\Properties\Options\Items; +use PhpMyAdmin\Plugins; +use PhpMyAdmin\Plugins\Plugin; use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem; +use function htmlspecialchars; + /** * Single property item class of type hidden */ class HiddenPropertyItem extends OptionsPropertyOneItem { + public function getHtml(Plugin $plugin, string $section, string $pluginName): string + { + return '
  • '; + } } diff --git a/src/Properties/Options/Items/MessageOnlyPropertyItem.php b/src/Properties/Options/Items/MessageOnlyPropertyItem.php index 1f8ed8b657..5a994e46ac 100644 --- a/src/Properties/Options/Items/MessageOnlyPropertyItem.php +++ b/src/Properties/Options/Items/MessageOnlyPropertyItem.php @@ -4,6 +4,8 @@ declare(strict_types=1); namespace PhpMyAdmin\Properties\Options\Items; +use PhpMyAdmin\Plugins; +use PhpMyAdmin\Plugins\Plugin; use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem; /** @@ -11,4 +13,12 @@ use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem; */ class MessageOnlyPropertyItem extends OptionsPropertyOneItem { + public function getHtml(Plugin $plugin, string $section, string $pluginName): string + { + $ret = '
  • ' . "\n"; + $ret .= $plugin->getTranslatedText($this->getText() ?? ''); + $ret .= Plugins::getDocumentationLinkHtml($this); + + return $ret; + } } diff --git a/src/Properties/Options/Items/NumberPropertyItem.php b/src/Properties/Options/Items/NumberPropertyItem.php index 5722232964..c02b075bc4 100644 --- a/src/Properties/Options/Items/NumberPropertyItem.php +++ b/src/Properties/Options/Items/NumberPropertyItem.php @@ -4,11 +4,35 @@ declare(strict_types=1); namespace PhpMyAdmin\Properties\Options\Items; +use PhpMyAdmin\Plugins; +use PhpMyAdmin\Plugins\Plugin; use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem; +use function htmlspecialchars; + /** * Single property item class of type number */ class NumberPropertyItem extends OptionsPropertyOneItem { + public function getHtml(Plugin $plugin, string $section, string $pluginName): string + { + $ret = '
  • ' . "\n"; + $ret .= ''; + $ret .= ''; + + return $ret; + } } diff --git a/src/Properties/Options/Items/RadioPropertyItem.php b/src/Properties/Options/Items/RadioPropertyItem.php index fb06a7546e..8780b95242 100644 --- a/src/Properties/Options/Items/RadioPropertyItem.php +++ b/src/Properties/Options/Items/RadioPropertyItem.php @@ -4,11 +4,42 @@ declare(strict_types=1); namespace PhpMyAdmin\Properties\Options\Items; +use PhpMyAdmin\Plugins; +use PhpMyAdmin\Plugins\Plugin; use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem; +use function htmlspecialchars; + /** * Single property item class of type radio */ class RadioPropertyItem extends OptionsPropertyOneItem { + public function getHtml(Plugin $plugin, string $section, string $pluginName): string + { + $default = htmlspecialchars($plugin->getTranslatedText(Plugins::getDefault( + $section, + $pluginName . '_' . $this->getName(), + ))); + + $ret = '
  • '; + + foreach ($this->getValues() as $key => $val) { + $ret .= '
    getName() . '_' . $key . '">' + . $plugin->getTranslatedText((string) $val) . '
    '; + } + + $ret .= '
  • '; + + return $ret; + } } diff --git a/src/Properties/Options/Items/SelectPropertyItem.php b/src/Properties/Options/Items/SelectPropertyItem.php index c88a16f38c..1e623f4e83 100644 --- a/src/Properties/Options/Items/SelectPropertyItem.php +++ b/src/Properties/Options/Items/SelectPropertyItem.php @@ -4,11 +4,43 @@ declare(strict_types=1); namespace PhpMyAdmin\Properties\Options\Items; +use PhpMyAdmin\Plugins; +use PhpMyAdmin\Plugins\Plugin; use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem; +use function htmlspecialchars; + /** * Single property item class of type select */ class SelectPropertyItem extends OptionsPropertyOneItem { + public function getHtml(Plugin $plugin, string $section, string $pluginName): string + { + $ret = '
  • ' . "\n"; + $ret .= ''; + $ret .= ''; + $ret .= Plugins::getDocumentationLinkHtml($this); + + return $ret; + } } diff --git a/src/Properties/Options/Items/TextPropertyItem.php b/src/Properties/Options/Items/TextPropertyItem.php index c87d0c0648..b5c32261b9 100644 --- a/src/Properties/Options/Items/TextPropertyItem.php +++ b/src/Properties/Options/Items/TextPropertyItem.php @@ -4,11 +4,41 @@ declare(strict_types=1); namespace PhpMyAdmin\Properties\Options\Items; +use PhpMyAdmin\Plugins; +use PhpMyAdmin\Plugins\Plugin; use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem; +use function htmlspecialchars; + /** * Single property item class of type text */ class TextPropertyItem extends OptionsPropertyOneItem { + public function getHtml(Plugin $plugin, string $section, string $pluginName): string + { + $ret = '
  • ' . "\n"; + $ret .= ''; + $ret .= 'getSize() !== 0 + ? ' size="' . $this->getSize() . '"' + : '') + . ($this->getLen() !== 0 + ? ' maxlength="' . $this->getLen() . '"' + : '') + . '>'; + $ret .= Plugins::getDocumentationLinkHtml($this); + + return $ret; + } } From 2702f2814e5cc5a1f9d1e6f2ac51b8ee12c91826 Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Sat, 14 Feb 2026 17:44:36 +0000 Subject: [PATCH 07/11] PluginType enum Signed-off-by: Kamil Tekiela --- phpstan-baseline.neon | 36 ---------- psalm-baseline.xml | 24 +------ src/Controllers/Database/ImportController.php | 5 +- src/Controllers/Server/ImportController.php | 5 +- src/Controllers/Table/ImportController.php | 5 +- src/Database/Designer.php | 3 +- src/Export/Options.php | 3 +- src/Plugins.php | 66 +++++++------------ src/Plugins/PluginType.php | 12 ++++ .../Options/Items/BoolPropertyItem.php | 5 +- .../Options/Items/HiddenPropertyItem.php | 5 +- .../Options/Items/MessageOnlyPropertyItem.php | 3 +- .../Options/Items/NumberPropertyItem.php | 5 +- .../Options/Items/RadioPropertyItem.php | 5 +- .../Options/Items/SelectPropertyItem.php | 5 +- .../Options/Items/TextPropertyItem.php | 5 +- .../Table/ExportControllerTest.php | 3 +- .../Table/ImportControllerTest.php | 3 +- tests/unit/Export/OptionsTest.php | 3 +- tests/unit/PluginsTest.php | 32 ++++----- 20 files changed, 95 insertions(+), 138 deletions(-) create mode 100644 src/Plugins/PluginType.php diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 8bb0f61768..21f14ec2c4 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -10596,24 +10596,6 @@ parameters: count: 1 path: src/Properties/Options/Items/BoolPropertyItem.php - - - message: '#^Parameter \#1 \$section of static method PhpMyAdmin\\Plugins\:\:checkboxCheck\(\) expects ''Export''\|''Import''\|''Schema'', string given\.$#' - identifier: argument.type - count: 1 - path: src/Properties/Options/Items/BoolPropertyItem.php - - - - message: '#^Parameter \#1 \$section of static method PhpMyAdmin\\Plugins\:\:getDefault\(\) expects ''Export''\|''Import''\|''Schema'', string given\.$#' - identifier: argument.type - count: 1 - path: src/Properties/Options/Items/HiddenPropertyItem.php - - - - message: '#^Parameter \#1 \$section of static method PhpMyAdmin\\Plugins\:\:getDefault\(\) expects ''Export''\|''Import''\|''Schema'', string given\.$#' - identifier: argument.type - count: 1 - path: src/Properties/Options/Items/NumberPropertyItem.php - - message: '#^Cannot cast mixed to string\.$#' identifier: cast.string @@ -10626,12 +10608,6 @@ parameters: count: 1 path: src/Properties/Options/Items/RadioPropertyItem.php - - - message: '#^Parameter \#1 \$section of static method PhpMyAdmin\\Plugins\:\:getDefault\(\) expects ''Export''\|''Import''\|''Schema'', string given\.$#' - identifier: argument.type - count: 1 - path: src/Properties/Options/Items/RadioPropertyItem.php - - message: '#^Cannot cast mixed to string\.$#' identifier: cast.string @@ -10644,18 +10620,6 @@ parameters: count: 1 path: src/Properties/Options/Items/SelectPropertyItem.php - - - message: '#^Parameter \#1 \$section of static method PhpMyAdmin\\Plugins\:\:getDefault\(\) expects ''Export''\|''Import''\|''Schema'', string given\.$#' - identifier: argument.type - count: 1 - path: src/Properties/Options/Items/SelectPropertyItem.php - - - - message: '#^Parameter \#1 \$section of static method PhpMyAdmin\\Plugins\:\:getDefault\(\) expects ''Export''\|''Import''\|''Schema'', string 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 c5ed60753d..382309f213 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -5607,14 +5607,14 @@ - settings[$section][$opt]]]> + settings[$pluginType->value][$opt]]]> getName()]]> getName()]]> - settings[$section][$opt])]]> + settings[$pluginType->value][$opt])]]> @@ -7205,9 +7205,6 @@ - - - getForce()]]> getForce()]]> @@ -7218,9 +7215,6 @@ - - - getName()]]> getName()]]> @@ -7229,13 +7223,10 @@ - + - - - getName()]]> getName()]]> @@ -7244,9 +7235,6 @@ - - - @@ -7258,9 +7246,6 @@ - - - @@ -7272,9 +7257,6 @@ - - - getName()]]> getName()]]> diff --git a/src/Controllers/Database/ImportController.php b/src/Controllers/Database/ImportController.php index f5ac290186..5ab583eeb7 100644 --- a/src/Controllers/Database/ImportController.php +++ b/src/Controllers/Database/ImportController.php @@ -20,6 +20,7 @@ use PhpMyAdmin\Import\Import; use PhpMyAdmin\Import\ImportSettings; use PhpMyAdmin\Message; use PhpMyAdmin\Plugins; +use PhpMyAdmin\Plugins\PluginType; use PhpMyAdmin\ResponseRenderer; use PhpMyAdmin\Routing\Route; use PhpMyAdmin\Util; @@ -93,9 +94,9 @@ final readonly class ImportController implements InvocableController $hiddenInputs = [$idKey => $uploadId, 'import_type' => 'database', 'db' => Current::$database]; $choice = Plugins::getChoice($importList, $this->getFormat($request->getParam('format'))); - $options = Plugins::getOptions('Import', $importList); + $options = Plugins::getOptions(PluginType::Import, $importList); $skipQueriesDefault = $this->getSkipQueries($request->getParam('skip_queries')); - $isAllowInterruptChecked = Plugins::checkboxCheck('Import', 'allow_interrupt'); + $isAllowInterruptChecked = Plugins::checkboxCheck(PluginType::Import, 'allow_interrupt'); $maxUploadSize = Util::getUploadSizeInBytes(); $this->response->render('database/import/index', [ diff --git a/src/Controllers/Server/ImportController.php b/src/Controllers/Server/ImportController.php index e471358274..238d81a7af 100644 --- a/src/Controllers/Server/ImportController.php +++ b/src/Controllers/Server/ImportController.php @@ -18,6 +18,7 @@ use PhpMyAdmin\Import\Import; use PhpMyAdmin\Import\ImportSettings; use PhpMyAdmin\Message; use PhpMyAdmin\Plugins; +use PhpMyAdmin\Plugins\PluginType; use PhpMyAdmin\ResponseRenderer; use PhpMyAdmin\Routing\Route; use PhpMyAdmin\Util; @@ -78,9 +79,9 @@ final readonly class ImportController implements InvocableController $hiddenInputs = [$idKey => $uploadId, 'import_type' => 'server']; $choice = Plugins::getChoice($importList, $this->getFormat($request->getParam('format'))); - $options = Plugins::getOptions('Import', $importList); + $options = Plugins::getOptions(PluginType::Import, $importList); $skipQueriesDefault = $this->getSkipQueries($request->getParam('skip_queries')); - $isAllowInterruptChecked = Plugins::checkboxCheck('Import', 'allow_interrupt'); + $isAllowInterruptChecked = Plugins::checkboxCheck(PluginType::Import, 'allow_interrupt'); $maxUploadSize = Util::getUploadSizeInBytes(); $this->response->render('server/import/index', [ diff --git a/src/Controllers/Table/ImportController.php b/src/Controllers/Table/ImportController.php index 7d98c8bf02..d78a350a7a 100644 --- a/src/Controllers/Table/ImportController.php +++ b/src/Controllers/Table/ImportController.php @@ -21,6 +21,7 @@ use PhpMyAdmin\Import\Import; use PhpMyAdmin\Import\ImportSettings; use PhpMyAdmin\Message; use PhpMyAdmin\Plugins; +use PhpMyAdmin\Plugins\PluginType; use PhpMyAdmin\ResponseRenderer; use PhpMyAdmin\Routing\Route; use PhpMyAdmin\Url; @@ -122,9 +123,9 @@ final readonly class ImportController implements InvocableController ]; $choice = Plugins::getChoice($importList, $this->getFormat($request->getParam('format'))); - $options = Plugins::getOptions('Import', $importList); + $options = Plugins::getOptions(PluginType::Import, $importList); $skipQueriesDefault = $this->getSkipQueries($request->getParam('skip_queries')); - $isAllowInterruptChecked = Plugins::checkboxCheck('Import', 'allow_interrupt'); + $isAllowInterruptChecked = Plugins::checkboxCheck(PluginType::Import, 'allow_interrupt'); $maxUploadSize = Util::getUploadSizeInBytes(); $this->response->render('table/import/index', [ diff --git a/src/Database/Designer.php b/src/Database/Designer.php index 68d89cb1eb..7ff2d52b2c 100644 --- a/src/Database/Designer.php +++ b/src/Database/Designer.php @@ -12,6 +12,7 @@ use PhpMyAdmin\Database\Designer\DesignerTable; use PhpMyAdmin\Dbal\DatabaseInterface; use PhpMyAdmin\Message; use PhpMyAdmin\Plugins; +use PhpMyAdmin\Plugins\PluginType; use PhpMyAdmin\Template; use PhpMyAdmin\Util; use stdClass; @@ -118,7 +119,7 @@ class Designer } $choice = Plugins::getChoice($exportList, $this->getFormat($formatParam, $exportTypeParam)); - $options = Plugins::getOptions('Schema', $exportList); + $options = Plugins::getOptions(PluginType::Schema, $exportList); return $this->template->render('database/designer/schema_export', [ 'db' => $db, diff --git a/src/Export/Options.php b/src/Export/Options.php index aaf7deca16..21918fcde8 100644 --- a/src/Export/Options.php +++ b/src/Export/Options.php @@ -13,6 +13,7 @@ use PhpMyAdmin\Encoding; use PhpMyAdmin\Plugins; use PhpMyAdmin\Plugins\ExportPlugin; use PhpMyAdmin\Plugins\ExportType; +use PhpMyAdmin\Plugins\PluginType; use PhpMyAdmin\Query\Utilities; use PhpMyAdmin\Table\Table; use PhpMyAdmin\Util; @@ -178,7 +179,7 @@ final readonly class Options 'hidden_inputs' => $hiddenInputs, 'export_method' => $_POST['quick_or_custom'] ?? $config->config->Export->method, 'plugins_choice' => $dropdown, - 'options' => Plugins::getOptions('Export', $exportList), + 'options' => Plugins::getOptions(PluginType::Export, $exportList), 'can_convert_kanji' => Encoding::canConvertKanji(), 'exec_time_limit' => $config->settings['ExecTimeLimit'], 'rows' => $rows, diff --git a/src/Plugins.php b/src/Plugins.php index 0ee81fa5d1..792e39a18e 100644 --- a/src/Plugins.php +++ b/src/Plugins.php @@ -16,6 +16,7 @@ use PhpMyAdmin\Plugins\ExportPlugin; use PhpMyAdmin\Plugins\ExportType; use PhpMyAdmin\Plugins\ImportPlugin; use PhpMyAdmin\Plugins\Plugin; +use PhpMyAdmin\Plugins\PluginType; use PhpMyAdmin\Plugins\SchemaPlugin; use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyMainGroup; use PhpMyAdmin\Properties\Options\Groups\OptionsPropertySubgroup; @@ -197,21 +198,18 @@ class Plugins * Returns html input tag option 'checked' if plugin $opt * should be set by config or request * - * @param string $section name of config section in - * \PhpMyAdmin\Config::getInstance()->settings[$section] for plugin - * @param string $opt name of option - * @psalm-param 'Export'|'Import'|'Schema' $section + * @param string $opt name of option * * @return string html input tag option 'checked' */ - public static function checkboxCheck(string $section, string $opt): string + public static function checkboxCheck(PluginType $pluginType, string $opt): string { // If the form is being repopulated using $_GET data, that is priority if ( isset($_GET[$opt]) || ! isset($_GET['repopulate']) && ((ImportSettings::$timeoutPassed && isset($_REQUEST[$opt])) - || ! empty(Config::getInstance()->settings[$section][$opt])) + || ! empty(Config::getInstance()->settings[$pluginType->value][$opt])) ) { return ' checked'; } @@ -222,14 +220,12 @@ class Plugins /** * Returns default value for option $opt * - * @param string $section name of config section in - * \PhpMyAdmin\Config::getInstance()->settings[$section] for plugin - * @param string $opt name of option - * @psalm-param 'Export'|'Import'|'Schema' $section + * @param PluginType $pluginType type of the plugin + * @param string $opt name of option * * @return string default value for option $opt */ - public static function getDefault(string $section, string $opt): string + public static function getDefault(PluginType $pluginType, string $opt): string { if (isset($_GET[$opt]) && is_string($_GET[$opt])) { // If the form is being repopulated using $_GET data, that is priority @@ -241,8 +237,8 @@ class Plugins } $config = Config::getInstance(); - if (isset($config->settings[$section][$opt])) { - return (string) $config->settings[$section][$opt]; + if (isset($config->settings[$pluginType->value][$opt])) { + return (string) $config->settings[$pluginType->value][$opt]; } return ''; @@ -274,17 +270,15 @@ class Plugins /** * Returns single option in a list element * - * @param string $section name of config section in $cfg[$section] for plugin * @param string $pluginName unique plugin name * @param OptionsPropertyItem $propertyGroup options property main group instance * @param bool $isSubgroup if this group is a subgroup - * @psalm-param 'Export'|'Import'|'Schema' $section * * @return string table row with option */ private static function getOneOption( Plugin $plugin, - string $section, + PluginType $pluginType, string $pluginName, OptionsPropertyItem $propertyGroup, bool $isSubgroup = false, @@ -329,7 +323,7 @@ class Plugins // each subgroup can have a header, which may also be a form element $subgroupHeader = $propertyItem->getSubgroupHeader(); if ($subgroupHeader !== null) { - $ret .= self::getOneOption($plugin, $section, $pluginName, $subgroupHeader); + $ret .= self::getOneOption($plugin, $pluginType, $pluginName, $subgroupHeader); } $ret .= '
    • $propertyItem->getHtml($plugin, $section, $pluginName), - $propertyItem instanceof HiddenPropertyItem => $propertyItem->getHtml($plugin, $section, $pluginName), - $propertyItem instanceof MessageOnlyPropertyItem => $propertyItem->getHtml($plugin, $section, $pluginName), - $propertyItem instanceof RadioPropertyItem => $propertyItem->getHtml($plugin, $section, $pluginName), - $propertyItem instanceof SelectPropertyItem => $propertyItem->getHtml($plugin, $section, $pluginName), - $propertyItem instanceof TextPropertyItem => $propertyItem->getHtml($plugin, $section, $pluginName), - $propertyItem instanceof NumberPropertyItem => $propertyItem->getHtml($plugin, $section, $pluginName), + $propertyItem instanceof BoolPropertyItem => $propertyItem->getHtml($plugin, $pluginType, $pluginName), + $propertyItem instanceof HiddenPropertyItem => $propertyItem->getHtml($plugin, $pluginType, $pluginName), + $propertyItem instanceof MessageOnlyPropertyItem => $propertyItem->getHtml($plugin, $pluginType, $pluginName), + $propertyItem instanceof RadioPropertyItem => $propertyItem->getHtml($plugin, $pluginType, $pluginName), + $propertyItem instanceof SelectPropertyItem => $propertyItem->getHtml($plugin, $pluginType, $pluginName), + $propertyItem instanceof TextPropertyItem => $propertyItem->getHtml($plugin, $pluginType, $pluginName), + $propertyItem instanceof NumberPropertyItem => $propertyItem->getHtml($plugin, $pluginType, $pluginName), default => '', }; } @@ -388,13 +374,11 @@ class Plugins /** * Returns html div with editable options for plugin * - * @param string $section name of config section in $cfg[$section] - * @param ExportPlugin[]|ImportPlugin[]|SchemaPlugin[] $list array with plugin instances - * @psalm-param 'Export'|'Import'|'Schema' $section + * @param ExportPlugin[]|ImportPlugin[]|SchemaPlugin[] $list array with plugin instances * * @return string html fieldset with plugin options */ - public static function getOptions(string $section, array $list): string + public static function getOptions(PluginType $pluginType, array $list): string { $ret = ''; // Options for plugins that support them @@ -422,7 +406,7 @@ class Plugins } } - $ret .= self::getOneOption($plugin, $section, $pluginName, $propertyMainGroup); + $ret .= self::getOneOption($plugin, $pluginType, $pluginName, $propertyMainGroup); } } diff --git a/src/Plugins/PluginType.php b/src/Plugins/PluginType.php new file mode 100644 index 0000000000..387824d9a1 --- /dev/null +++ b/src/Plugins/PluginType.php @@ -0,0 +1,12 @@ +' . "\n"; $ret .= '
      ' . "\n"; @@ -23,7 +24,7 @@ class BoolPropertyItem extends OptionsPropertyOneItem . $this->getName() . '"' . ' ' . Plugins::checkboxCheck( - $section, + $pluginType, $pluginName . '_' . $this->getName(), ); diff --git a/src/Properties/Options/Items/HiddenPropertyItem.php b/src/Properties/Options/Items/HiddenPropertyItem.php index 21492ac6b5..74e0709970 100644 --- a/src/Properties/Options/Items/HiddenPropertyItem.php +++ b/src/Properties/Options/Items/HiddenPropertyItem.php @@ -6,6 +6,7 @@ namespace PhpMyAdmin\Properties\Options\Items; use PhpMyAdmin\Plugins; use PhpMyAdmin\Plugins\Plugin; +use PhpMyAdmin\Plugins\PluginType; use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem; use function htmlspecialchars; @@ -15,13 +16,13 @@ use function htmlspecialchars; */ class HiddenPropertyItem extends OptionsPropertyOneItem { - public function getHtml(Plugin $plugin, string $section, string $pluginName): string + public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string { return '
    • '; diff --git a/src/Properties/Options/Items/MessageOnlyPropertyItem.php b/src/Properties/Options/Items/MessageOnlyPropertyItem.php index 5a994e46ac..a1b7e1ae93 100644 --- a/src/Properties/Options/Items/MessageOnlyPropertyItem.php +++ b/src/Properties/Options/Items/MessageOnlyPropertyItem.php @@ -6,6 +6,7 @@ namespace PhpMyAdmin\Properties\Options\Items; use PhpMyAdmin\Plugins; use PhpMyAdmin\Plugins\Plugin; +use PhpMyAdmin\Plugins\PluginType; use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem; /** @@ -13,7 +14,7 @@ use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem; */ class MessageOnlyPropertyItem extends OptionsPropertyOneItem { - public function getHtml(Plugin $plugin, string $section, string $pluginName): string + public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string { $ret = '
    • ' . "\n"; $ret .= $plugin->getTranslatedText($this->getText() ?? ''); diff --git a/src/Properties/Options/Items/NumberPropertyItem.php b/src/Properties/Options/Items/NumberPropertyItem.php index c02b075bc4..6402b94cc7 100644 --- a/src/Properties/Options/Items/NumberPropertyItem.php +++ b/src/Properties/Options/Items/NumberPropertyItem.php @@ -6,6 +6,7 @@ namespace PhpMyAdmin\Properties\Options\Items; use PhpMyAdmin\Plugins; use PhpMyAdmin\Plugins\Plugin; +use PhpMyAdmin\Plugins\PluginType; use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem; use function htmlspecialchars; @@ -15,7 +16,7 @@ use function htmlspecialchars; */ class NumberPropertyItem extends OptionsPropertyOneItem { - public function getHtml(Plugin $plugin, string $section, string $pluginName): string + public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string { $ret = '
    • ' . "\n"; $ret .= '
    • ' . "\n"; $ret .= '
    • '; + . $plugin->getTranslatedText($val) . ''; } $ret .= ''; diff --git a/src/Properties/Options/Items/SelectPropertyItem.php b/src/Properties/Options/Items/SelectPropertyItem.php index 8fdb312f3c..9c064aa6ba 100644 --- a/src/Properties/Options/Items/SelectPropertyItem.php +++ b/src/Properties/Options/Items/SelectPropertyItem.php @@ -36,7 +36,7 @@ class SelectPropertyItem extends OptionsPropertyOneItem $ret .= ' selected'; } - $ret .= '>' . $plugin->getTranslatedText((string) $val) . ''; + $ret .= '>' . $plugin->getTranslatedText($val) . ''; } $ret .= ''; diff --git a/src/Properties/Options/OptionsPropertyOneItem.php b/src/Properties/Options/OptionsPropertyOneItem.php index 40a4fc4e3e..cc6434f641 100644 --- a/src/Properties/Options/OptionsPropertyOneItem.php +++ b/src/Properties/Options/OptionsPropertyOneItem.php @@ -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 { diff --git a/tests/unit/Properties/Options/OptionsPropertyOneItemTest.php b/tests/unit/Properties/Options/OptionsPropertyOneItemTest.php index 41b3e0284d..94d194fe6b 100644 --- a/tests/unit/Properties/Options/OptionsPropertyOneItemTest.php +++ b/tests/unit/Properties/Options/OptionsPropertyOneItemTest.php @@ -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(), ); } From 4d767f0c04b5c0537d900689d3216bff5ed1dbce Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Sat, 14 Feb 2026 18:02:21 +0000 Subject: [PATCH 09/11] Add getHtml as abstract method Signed-off-by: Kamil Tekiela --- psalm-baseline.xml | 6 ------ src/Plugins.php | 21 +++++-------------- .../Options/OptionsPropertyOneItem.php | 5 +++++ .../Options/OptionsPropertyOneItemTest.php | 2 +- 4 files changed, 11 insertions(+), 23 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index e58876cdbb..25edcfa9c4 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -7220,12 +7220,6 @@ getName()]]> - - - - - - getName()]]> diff --git a/src/Plugins.php b/src/Plugins.php index 792e39a18e..4b4809458f 100644 --- a/src/Plugins.php +++ b/src/Plugins.php @@ -20,13 +20,7 @@ use PhpMyAdmin\Plugins\PluginType; use PhpMyAdmin\Plugins\SchemaPlugin; use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyMainGroup; use PhpMyAdmin\Properties\Options\Groups\OptionsPropertySubgroup; -use PhpMyAdmin\Properties\Options\Items\BoolPropertyItem; use PhpMyAdmin\Properties\Options\Items\HiddenPropertyItem; -use PhpMyAdmin\Properties\Options\Items\MessageOnlyPropertyItem; -use PhpMyAdmin\Properties\Options\Items\NumberPropertyItem; -use PhpMyAdmin\Properties\Options\Items\RadioPropertyItem; -use PhpMyAdmin\Properties\Options\Items\SelectPropertyItem; -use PhpMyAdmin\Properties\Options\Items\TextPropertyItem; use PhpMyAdmin\Properties\Options\OptionsPropertyGroup; use PhpMyAdmin\Properties\Options\OptionsPropertyItem; use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem; @@ -359,16 +353,11 @@ class Plugins string $pluginName, OptionsPropertyItem $propertyItem, ): string { - return match (true) { - $propertyItem instanceof BoolPropertyItem => $propertyItem->getHtml($plugin, $pluginType, $pluginName), - $propertyItem instanceof HiddenPropertyItem => $propertyItem->getHtml($plugin, $pluginType, $pluginName), - $propertyItem instanceof MessageOnlyPropertyItem => $propertyItem->getHtml($plugin, $pluginType, $pluginName), - $propertyItem instanceof RadioPropertyItem => $propertyItem->getHtml($plugin, $pluginType, $pluginName), - $propertyItem instanceof SelectPropertyItem => $propertyItem->getHtml($plugin, $pluginType, $pluginName), - $propertyItem instanceof TextPropertyItem => $propertyItem->getHtml($plugin, $pluginType, $pluginName), - $propertyItem instanceof NumberPropertyItem => $propertyItem->getHtml($plugin, $pluginType, $pluginName), - default => '', - }; + if ($propertyItem instanceof OptionsPropertyOneItem) { + return $propertyItem->getHtml($plugin, $pluginType, $pluginName); + } + + return ''; } /** diff --git a/src/Properties/Options/OptionsPropertyOneItem.php b/src/Properties/Options/OptionsPropertyOneItem.php index cc6434f641..874fb13c36 100644 --- a/src/Properties/Options/OptionsPropertyOneItem.php +++ b/src/Properties/Options/OptionsPropertyOneItem.php @@ -7,6 +7,9 @@ declare(strict_types=1); namespace PhpMyAdmin\Properties\Options; +use PhpMyAdmin\Plugins\Plugin; +use PhpMyAdmin\Plugins\PluginType; + /** * Parents only single property items (not groups). * Defines possible options and getters and setters for them. @@ -83,4 +86,6 @@ abstract class OptionsPropertyOneItem extends OptionsPropertyItem { $this->size = $size; } + + abstract public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string; } diff --git a/tests/unit/Properties/Options/OptionsPropertyOneItemTest.php b/tests/unit/Properties/Options/OptionsPropertyOneItemTest.php index 94d194fe6b..650b110520 100644 --- a/tests/unit/Properties/Options/OptionsPropertyOneItemTest.php +++ b/tests/unit/Properties/Options/OptionsPropertyOneItemTest.php @@ -21,7 +21,7 @@ class OptionsPropertyOneItemTest extends AbstractTestCase { parent::setUp(); - $this->stub = $this->getMockBuilder(OptionsPropertyOneItem::class)->onlyMethods([])->getMock(); + $this->stub = $this->getMockBuilder(OptionsPropertyOneItem::class)->onlyMethods(['getHtml'])->getMock(); } /** From 4f8e5de24cce1a4f8da267b6031895ea975e36ac Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Sat, 14 Feb 2026 18:52:53 +0000 Subject: [PATCH 10/11] Align with other elements Signed-off-by: Kamil Tekiela --- src/Plugins.php | 2 +- .../Options/Items/HiddenPropertyItem.php | 2 +- .../Options/Items/RadioPropertyItem.php | 2 - tests/unit/PluginsTest.php | 46 +++++++++---------- 4 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/Plugins.php b/src/Plugins.php index 4b4809458f..b74220829c 100644 --- a/src/Plugins.php +++ b/src/Plugins.php @@ -338,7 +338,7 @@ class Plugins if ($isSubgroup) { // end subgroup - $ret .= '
  • '; + $ret .= ''; } elseif ($notSubgroupHeader) { // end main group $ret .= ''; diff --git a/src/Properties/Options/Items/HiddenPropertyItem.php b/src/Properties/Options/Items/HiddenPropertyItem.php index 74e0709970..60d62a2744 100644 --- a/src/Properties/Options/Items/HiddenPropertyItem.php +++ b/src/Properties/Options/Items/HiddenPropertyItem.php @@ -25,6 +25,6 @@ class HiddenPropertyItem extends OptionsPropertyOneItem $pluginType, $pluginName . '_' . $this->getName(), ))) - . '">'; + . '">'; } } diff --git a/src/Properties/Options/Items/RadioPropertyItem.php b/src/Properties/Options/Items/RadioPropertyItem.php index 6921153ffd..1b79f50a8a 100644 --- a/src/Properties/Options/Items/RadioPropertyItem.php +++ b/src/Properties/Options/Items/RadioPropertyItem.php @@ -39,8 +39,6 @@ class RadioPropertyItem extends OptionsPropertyOneItem . $plugin->getTranslatedText($val) . ''; } - $ret .= ''; - return $ret; } } diff --git a/tests/unit/PluginsTest.php b/tests/unit/PluginsTest.php index 00e9fac024..0ea9f88c99 100644 --- a/tests/unit/PluginsTest.php +++ b/tests/unit/PluginsTest.php @@ -226,7 +226,7 @@ class PluginsTest extends AbstractTestCase // phpcs:disable Generic.Files.LineLength.TooLong $expected = <<<'HTML'

    CodeGen

    -
    • +
    @@ -240,7 +240,7 @@ class PluginsTest extends AbstractTestCase
  • -
  • +
  • CSV for MS Excel

    @@ -250,11 +250,11 @@ class PluginsTest extends AbstractTestCase
  • -
  • +
  • JSON

    -
    • +
      • @@ -266,7 +266,7 @@ class PluginsTest extends AbstractTestCase
      -
      Dump table
      +
      Dump table
      Object creation options
      • Documentation
      • @@ -286,9 +286,9 @@ class PluginsTest extends AbstractTestCase

        MediaWiki Table

        Dump table
          -
        • +
          • -
        • +
      • @@ -297,7 +297,7 @@ class PluginsTest extends AbstractTestCase

      Microsoft Word 2000

      -
      Dump table
      +
      Dump table
      Data dump options
      • @@ -309,11 +309,11 @@ class PluginsTest extends AbstractTestCase
        • -
        +

    OpenDocument Text

    -
    Dump table
    +
    Dump table
    Object creation options
    • @@ -329,11 +329,11 @@ class PluginsTest extends AbstractTestCase
      -
      Dump table
      +
      Dump table

      PHP array

      -
      +

      This format has no options

      SQL

      @@ -345,7 +345,7 @@ class PluginsTest extends AbstractTestCase
    • -
  • +
  • Documentation
  • @@ -356,9 +356,9 @@ class PluginsTest extends AbstractTestCase
  • Documentation -
  • +
    • -
  • +
    Object creation options
      @@ -376,7 +376,7 @@ class PluginsTest extends AbstractTestCase
    • -
    +
  • @@ -388,12 +388,12 @@ class PluginsTest extends AbstractTestCase
  • -
  • +
  • -
  • +
  • @@ -408,13 +408,13 @@ class PluginsTest extends AbstractTestCase
    Documentation
  • -
    Documentation
  • + Documentation
  • Syntax to use when inserting data:
    • -
  • +
  • @@ -424,7 +424,7 @@ class PluginsTest extends AbstractTestCase

    Texy! text

    -
    Dump table
    +
    Dump table
    Data dump options
    • @@ -435,11 +435,11 @@ class PluginsTest extends AbstractTestCase

      TOON

      • -
      +

    YAML

    -
    +

    This format has no options

    From ecd109d1e602af3e2b110d53f077a3a77a38d905 Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Sat, 14 Feb 2026 20:11:47 +0000 Subject: [PATCH 11/11] Put newlines at the end of li and ul It should not change how the HTML is rendered on the screen. It makes the output more well-structured. Signed-off-by: Kamil Tekiela --- src/Plugins.php | 16 +- .../Options/Items/BoolPropertyItem.php | 4 +- .../Options/Items/MessageOnlyPropertyItem.php | 2 +- .../Options/Items/NumberPropertyItem.php | 2 +- .../Options/Items/SelectPropertyItem.php | 2 +- .../Options/Items/TextPropertyItem.php | 2 +- tests/unit/PluginsTest.php | 406 ++++++++---------- 7 files changed, 204 insertions(+), 230 deletions(-) diff --git a/src/Plugins.php b/src/Plugins.php index b74220829c..9b945195f1 100644 --- a/src/Plugins.php +++ b/src/Plugins.php @@ -277,7 +277,7 @@ class Plugins OptionsPropertyItem $propertyGroup, bool $isSubgroup = false, ): string { - $ret = "\n"; + $ret = ''; $properties = null; if (! $isSubgroup) { @@ -286,7 +286,7 @@ class Plugins $properties = [$propertyGroup]; } else { // for main groups - $ret .= '
    '; + $ret .= "\n" . '
    '; $text = null; if (method_exists($propertyGroup, 'getText')) { @@ -297,7 +297,7 @@ class Plugins $ret .= '
    ' . $plugin->getTranslatedText($text) . '
    '; } - $ret .= '
      '; + $ret .= '
        ' . "\n"; } } @@ -327,6 +327,8 @@ class Plugins $ret .= '>'; } + $ret .= "\n"; + $ret .= self::getOneOption($plugin, $pluginType, $pluginName, $propertyItem, true); continue; } @@ -338,13 +340,13 @@ class Plugins if ($isSubgroup) { // end subgroup - $ret .= '
      '; + $ret .= '
    ' . "\n"; } elseif ($notSubgroupHeader) { // end main group - $ret .= '
    '; + $ret .= '
    ' . "\n"; } - return $ret . "\n"; + return $ret; } private static function getHtmlForProperty( @@ -354,7 +356,7 @@ class Plugins OptionsPropertyItem $propertyItem, ): string { if ($propertyItem instanceof OptionsPropertyOneItem) { - return $propertyItem->getHtml($plugin, $pluginType, $pluginName); + return $propertyItem->getHtml($plugin, $pluginType, $pluginName) . "\n"; } return ''; diff --git a/src/Properties/Options/Items/BoolPropertyItem.php b/src/Properties/Options/Items/BoolPropertyItem.php index b38e4d3f27..ec4ba2efdf 100644 --- a/src/Properties/Options/Items/BoolPropertyItem.php +++ b/src/Properties/Options/Items/BoolPropertyItem.php @@ -16,8 +16,8 @@ class BoolPropertyItem extends OptionsPropertyOneItem { public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string { - $ret = '
  • ' . "\n"; - $ret .= '
    ' . "\n"; + $ret = '
  • '; + $ret .= '
    '; $ret .= '' . "\n"; + $ret = '
  • '; $ret .= $plugin->getTranslatedText($this->getText() ?? ''); $ret .= Plugins::getDocumentationLinkHtml($this); diff --git a/src/Properties/Options/Items/NumberPropertyItem.php b/src/Properties/Options/Items/NumberPropertyItem.php index 6402b94cc7..2ba3ca8d04 100644 --- a/src/Properties/Options/Items/NumberPropertyItem.php +++ b/src/Properties/Options/Items/NumberPropertyItem.php @@ -18,7 +18,7 @@ class NumberPropertyItem extends OptionsPropertyOneItem { public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string { - $ret = '
  • ' . "\n"; + $ret = '
  • '; $ret .= ''; diff --git a/src/Properties/Options/Items/SelectPropertyItem.php b/src/Properties/Options/Items/SelectPropertyItem.php index 9c064aa6ba..cb9d5a2e4c 100644 --- a/src/Properties/Options/Items/SelectPropertyItem.php +++ b/src/Properties/Options/Items/SelectPropertyItem.php @@ -18,7 +18,7 @@ class SelectPropertyItem extends OptionsPropertyOneItem { public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string { - $ret = '
  • ' . "\n"; + $ret = '
  • '; $ret .= ''; diff --git a/src/Properties/Options/Items/TextPropertyItem.php b/src/Properties/Options/Items/TextPropertyItem.php index 5c0b658ed1..59df3f6daf 100644 --- a/src/Properties/Options/Items/TextPropertyItem.php +++ b/src/Properties/Options/Items/TextPropertyItem.php @@ -18,7 +18,7 @@ class TextPropertyItem extends OptionsPropertyOneItem { public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string { - $ret = '
  • ' . "\n"; + $ret = '
  • '; $ret .= ''; diff --git a/tests/unit/PluginsTest.php b/tests/unit/PluginsTest.php index 0ea9f88c99..209fef6baa 100644 --- a/tests/unit/PluginsTest.php +++ b/tests/unit/PluginsTest.php @@ -157,32 +157,29 @@ class PluginsTest extends AbstractTestCase // phpcs:disable Generic.Files.LineLength.TooLong $expected = <<<'HTML'

    CSV

    -
    • -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
      -
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +

    CSV using LOAD DATA

    -
    • -
      -
    • -
    • -
    • -
    • -
    • -
    • -
      -
    • -
      -
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +

    ESRI Shape File

    This format has no options

    @@ -190,22 +187,19 @@ class PluginsTest extends AbstractTestCase

    MediaWiki Table

    This format has no options

    OpenDocument Spreadsheet

    -
    • -
      -
    • -
      -
    • -
      -
    • -
      -
    +
      +
    • +
    • +
    • +
    • +

    SQL

    -
    • - Documentation
    • -
      -
      Documentation
    +
      +
    • Documentation +
    • Documentation +

    XML

    This format has no options

    @@ -226,62 +220,66 @@ class PluginsTest extends AbstractTestCase // phpcs:disable Generic.Files.LineLength.TooLong $expected = <<<'HTML'

    CodeGen

    -
    • -
    +
      +
    • +
    • +

    CSV

    -
    • -
    • -
    • -
    • -
    • -
    • -
      -
    • -
      -
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +

    CSV for MS Excel

    -
    • -
    • -
      -
    • -
      -
    • -
    +
      +
    • +
    • +
    • +
    • +
    • +

    JSON

    -
    • -
      -
    • -
      -
    +
      +
    • +
    • +
    • +

    LaTeX

    -
    • -
      -
    +
      +
    • +
    -
    Dump table
    +
    Dump table
      +
    • +
    -
    Object creation options
    • - Documentation
    • - Documentation
    • - Documentation
    • -
      -
    +
    Object creation options
      +
    • Documentation +
    • Documentation +
    • Documentation +
    • +
    -
    Data dump options
    • -
      -
    • - Documentation
    • - Documentation
    • - Documentation
    • -
    +
    Data dump options
      +
    • +
    • Documentation +
    • Documentation +
    • Documentation +
    • +

    MediaWiki Table

    @@ -289,157 +287,140 @@ class PluginsTest extends AbstractTestCase
    -
  • -
    -
  • -
    -
    +
  • +
  • +

    Microsoft Word 2000

    -
    Dump table
    +
    Dump table
      +
    • +
    -
    Data dump options
    • -
    • -
      -
    +
    Data dump options
      +
    • +
    • +

    OpenDocument Spreadsheet

    -
    • -
    • -
      -
    +
      +
    • +
    • +
    • +

    OpenDocument Text

    -
    Dump table
    +
    Dump table
      +
    • +
    -
    Object creation options
    • -
      -
    +
    Object creation options
      +
    • +
    -
    Data dump options
    • -
      -
    • -
    +
    Data dump options
      +
    • +
    • +

    PDF

    -
    • -
    +
      +
    • +
    -
    Dump table
    +
    Dump table
      +
    • +

    PHP array

    -
    +
      +
    • +

    This format has no options

    SQL

      -
    • -
      -
      +
      • -
      • -
      • -
        -
      -
    • -
      -
      Documentation
    • -
      -
      Documentation
    • -
      -
    • -
      -
    • - Documentation +
    • +
    • +
    +
  • Documentation +
  • Documentation +
  • +
  • +
  • Documentation
    Object creation options
      -
    • - Add statements: +
    • Add statements:
      • -
      • -
        -
        -
      • -
        -
        +
      • +
        • -
        • -
          -
        • -
          -
        - -
      • -
        -
        +
      • +
      • +
      +
      • -
      • -
        -
      • -
        -
      • -
        -
      -
    • -
      -
    • -
      -
    -
  • -
    -
    +
  • +
  • +
  • + +
  • +
  • + +
  • + -
    Data creation options
    • -
      -
      +
      Data creation options
        +
      • -
        • -
        • -
          -
          Documentation
        • -
          -
          Documentation
        -
      • - -
      • - Syntax to use when inserting data: +
      • Documentation +
      • Documentation +
      +
    • +
    • Syntax to use when inserting data:
      • -
      -
    • -
    • -
      -
    • -
      -
    +
  • + +
  • +
  • +
  • +

    Texy! text

    -
    Dump table
    +
    Dump table
      +
    • +
    -
    Data dump options
    • -
      -
    • -
    +
    Data dump options
      +
    • +
    • +

    TOON

    -
    • -
    • -
    +
      +
    • +
    • +
    • +

    YAML

    -
    +
      +
    • +

    This format has no options

    @@ -457,51 +438,42 @@ class PluginsTest extends AbstractTestCase // phpcs:disable Generic.Files.LineLength.TooLong $expected = <<<'HTML'

    Dia

    -
    • -
      -
    • -
      -
    • -
    • -
    +
      +
    • +
    • +
    • +
    • +

    EPS

    -
    • -
      -
    • -
      -
    • -
      -
    • -
    +
      +
    • +
    • +
    • +
    • +

    PDF

    -
    • -
      -
    • -
      -
    • -
      -
    • -
    • -
    • -
      -
    • -
      -
    • -
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +

    SVG

    -
    • -
      -
    • -
      -
    • -
      -
    +
      +
    • +
    • +
    • +