Drop getItemType() and getPropertyType()

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

1
This commit is contained in:
Kamil Tekiela 2026-02-12 20:19:50 +00:00
parent 4c8dedc303
commit 5e52ee1725
28 changed files with 5 additions and 342 deletions

View File

@ -11,16 +11,4 @@ use PhpMyAdmin\Properties\Options\OptionsPropertyGroup;
*/
class OptionsPropertyMainGroup extends OptionsPropertyGroup
{
/**
* Returns the property item type of either an instance of
* - PhpMyAdmin\Properties\Options\OptionsPropertyOneItem ( f.e. "bool",
* "text", "radio", etc ) or
* - PhpMyAdmin\Properties\Options\OptionsPropertyGroup ( "root", "main"
* or "subgroup" )
* - PhpMyAdmin\Properties\Plugins\PluginPropertyItem ( "export", "import", "transformations" )
*/
public function getItemType(): string
{
return 'main';
}
}

View File

@ -11,16 +11,4 @@ use PhpMyAdmin\Properties\Options\OptionsPropertyGroup;
*/
class OptionsPropertyRootGroup extends OptionsPropertyGroup
{
/**
* Returns the property item type of either an instance of
* - PhpMyAdmin\Properties\Options\OptionsPropertyOneItem ( f.e. "bool",
* "text", "radio", etc ) or
* - PhpMyAdmin\Properties\Options\OptionsPropertyGroup ( "root", "main"
* or "subgroup" )
* - PhpMyAdmin\Properties\Plugins\PluginPropertyItem ( "export", "import", "transformations" )
*/
public function getItemType(): string
{
return 'root';
}
}

View File

@ -13,20 +13,6 @@ use PhpMyAdmin\Properties\PropertyItem;
class OptionsPropertySubgroup extends OptionsPropertyGroup
{
private PropertyItem|null $subgroupHeader = null;
/* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
/**
* Returns the property item type of either an instance of
* - PhpMyAdmin\Properties\Options\OptionsPropertyOneItem ( f.e. "bool",
* "text", "radio", etc ) or
* - PhpMyAdmin\Properties\Options\OptionsPropertyGroup ( "root", "main"
* or "subgroup" )
* - PhpMyAdmin\Properties\Plugins\PluginPropertyItem ( "export", "import", "transformations" )
*/
public function getItemType(): string
{
return 'subgroup';
}
public function getSubgroupHeader(): PropertyItem|null
{

View File

@ -11,16 +11,4 @@ use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem;
*/
class BoolPropertyItem extends OptionsPropertyOneItem
{
/**
* Returns the property item type of either an instance of
* - PhpMyAdmin\Properties\Options\OptionsPropertyOneItem ( f.e. "bool",
* "text", "radio", etc ) or
* - PhpMyAdmin\Properties\Options\OptionsPropertyGroup ( "root", "main"
* or "subgroup" )
* - PhpMyAdmin\Properties\Plugins\PluginPropertyItem ( "export", "import", "transformations" )
*/
public function getItemType(): string
{
return 'bool';
}
}

View File

@ -11,16 +11,4 @@ use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem;
*/
class DocPropertyItem extends OptionsPropertyOneItem
{
/**
* Returns the property item type of either an instance of
* - PhpMyAdmin\Properties\Options\OptionsPropertyOneItem ( f.e. "bool",
* "text", "radio", etc ) or
* - PhpMyAdmin\Properties\Options\OptionsPropertyGroup ( "root", "main"
* or "subgroup" )
* - PhpMyAdmin\Properties\Plugins\PluginPropertyItem ( "export", "import", "transformations" )
*/
public function getItemType(): string
{
return 'doc';
}
}

View File

@ -11,16 +11,4 @@ use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem;
*/
class HiddenPropertyItem extends OptionsPropertyOneItem
{
/**
* Returns the property item type of either an instance of
* - PhpMyAdmin\Properties\Options\OptionsPropertyOneItem ( f.e. "bool",
* "text", "radio", etc ) or
* - PhpMyAdmin\Properties\Options\OptionsPropertyGroup ( "root", "main"
* or "subgroup" )
* - PhpMyAdmin\Properties\Plugins\PluginPropertyItem ( "export", "import", "transformations" )
*/
public function getItemType(): string
{
return 'hidden';
}
}

View File

@ -11,16 +11,4 @@ use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem;
*/
class MessageOnlyPropertyItem extends OptionsPropertyOneItem
{
/**
* Returns the property item type of either an instance of
* - PhpMyAdmin\Properties\Options\OptionsPropertyOneItem ( f.e. "bool",
* "text", "radio", etc ) or
* - PhpMyAdmin\Properties\Options\OptionsPropertyGroup ( "root", "main"
* or "subgroup" )
* - PhpMyAdmin\Properties\Plugins\PluginPropertyItem ( "export", "import", "transformations" )
*/
public function getItemType(): string
{
return 'messageOnly';
}
}

View File

@ -11,16 +11,4 @@ use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem;
*/
class NumberPropertyItem extends OptionsPropertyOneItem
{
/**
* Returns the property item type of either an instance of
* - PhpMyAdmin\Properties\Options\OptionsPropertyOneItem ( f.e. "bool",
* "text", "radio", etc ) or
* - PhpMyAdmin\Properties\Options\OptionsPropertyGroup ( "root", "main"
* or "subgroup" )
* - PhpMyAdmin\Properties\Plugins\PluginPropertyItem ( "export", "import", "transformations" )
*/
public function getItemType(): string
{
return 'number';
}
}

View File

@ -11,16 +11,4 @@ use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem;
*/
class RadioPropertyItem extends OptionsPropertyOneItem
{
/**
* Returns the property item type of either an instance of
* - PhpMyAdmin\Properties\Options\OptionsPropertyOneItem ( f.e. "bool",
* "text", "radio", etc ) or
* - PhpMyAdmin\Properties\Options\OptionsPropertyGroup ( "root", "main"
* or "subgroup" )
* - PhpMyAdmin\Properties\Plugins\PluginPropertyItem ( "export", "import", "transformations" )
*/
public function getItemType(): string
{
return 'radio';
}
}

View File

@ -11,16 +11,4 @@ use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem;
*/
class SelectPropertyItem extends OptionsPropertyOneItem
{
/**
* Returns the property item type of either an instance of
* - PhpMyAdmin\Properties\Options\OptionsPropertyOneItem ( f.e. "bool",
* "text", "radio", etc ) or
* - PhpMyAdmin\Properties\Options\OptionsPropertyGroup ( "root", "main"
* or "subgroup" )
* - PhpMyAdmin\Properties\Plugins\PluginPropertyItem ( "export", "import", "transformations" )
*/
public function getItemType(): string
{
return 'select';
}
}

View File

@ -11,16 +11,4 @@ use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem;
*/
class TextPropertyItem extends OptionsPropertyOneItem
{
/**
* Returns the property item type of either an instance of
* - PhpMyAdmin\Properties\Options\OptionsPropertyOneItem ( f.e. "bool",
* "text", "radio", etc ) or
* - PhpMyAdmin\Properties\Options\OptionsPropertyGroup ( "root", "main"
* or "subgroup" )
* - PhpMyAdmin\Properties\Plugins\PluginPropertyItem ( "export", "import", "transformations" )
*/
public function getItemType(): string
{
return 'text';
}
}

View File

@ -55,12 +55,4 @@ abstract class OptionsPropertyItem extends PropertyItem
{
$this->force = $force;
}
/**
* Returns the property type ( either "options", or "plugin" ).
*/
public function getPropertyType(): string
{
return 'options';
}
}

View File

@ -19,17 +19,6 @@ class ExportPluginProperties extends PluginPropertyItem
*/
private bool $forceFile = false;
/**
* Returns the property item type of either an instance of
* - PhpMyAdmin\Properties\Options\OptionsPropertyOneItem ( f.e. "bool", "text", "radio", etc ) or
* - PhpMyAdmin\Properties\Options\OptionsPropertyGroup ( "root", "main" or "subgroup" )
* - PhpMyAdmin\Properties\Plugins\PluginPropertyItem ( "export", "import", "transformations" )
*/
public function getItemType(): string
{
return 'export';
}
/**
* Gets the force file parameter
*/

View File

@ -12,17 +12,6 @@ namespace PhpMyAdmin\Properties\Plugins;
*/
class ImportPluginProperties extends PluginPropertyItem
{
/**
* Returns the property item type of either an instance of
* - PhpMyAdmin\Properties\Options\OptionsPropertyOneItem ( f.e. "bool", "text", "radio", etc ) or
* - PhpMyAdmin\Properties\Options\OptionsPropertyGroup ( "root", "main" or "subgroup" )
* - PhpMyAdmin\Properties\Plugins\PluginPropertyItem ( "export", "import", "transformations" )
*/
public function getItemType(): string
{
return 'import';
}
public function getForceFile(): bool
{
return true;

View File

@ -75,14 +75,6 @@ abstract class PluginPropertyItem extends PropertyItem
$this->mimeType = $mimeType;
}
/**
* Returns the property type ( either "options", or "plugin" ).
*/
public function getPropertyType(): string
{
return 'plugin';
}
/**
* Whether each plugin has to be saved as a file
*/

View File

@ -12,17 +12,6 @@ namespace PhpMyAdmin\Properties\Plugins;
*/
class SchemaPluginProperties extends PluginPropertyItem
{
/**
* Returns the property item type of either an instance of
* - PhpMyAdmin\Properties\Options\OptionsPropertyOneItem ( f.e. "bool", "text", "radio", etc ) or
* - PhpMyAdmin\Properties\Options\OptionsPropertyGroup ( "root", "main" or "subgroup" )
* - PhpMyAdmin\Properties\Plugins\PluginPropertyItem ( "export", "import", "transformations" )
*/
public function getItemType(): string
{
return 'schema';
}
public function getForceFile(): bool
{
return true;

View File

@ -12,16 +12,4 @@ namespace PhpMyAdmin\Properties;
*/
abstract class PropertyItem
{
/**
* Returns the property type ( either "Options", or "Plugin" ).
*/
abstract public function getPropertyType(): string;
/**
* Returns the property item type of either an instance of
* - PhpMyAdmin\Properties\Options\OptionsPropertyOneItem ( f.e. "bool", "text", "radio", etc ) or
* - PhpMyAdmin\Properties\Options\OptionsPropertyGroup ( "root", "main" or "subgroup" )
* - PhpMyAdmin\Properties\Plugins\PluginPropertyItem ( "export", "import", "transformations" )
*/
abstract public function getItemType(): string;
}

View File

@ -32,12 +32,4 @@ class OptionsPropertyMainGroupTest extends AbstractTestCase
unset($this->object);
}
public function testGetItemType(): void
{
self::assertSame(
'main',
$this->object->getItemType(),
);
}
}

View File

@ -33,14 +33,6 @@ class OptionsPropertyRootGroupTest extends AbstractTestCase
unset($this->object);
}
public function testGetItemType(): void
{
self::assertSame(
'root',
$this->object->getItemType(),
);
}
/**
* Test for contable interface
*/

View File

@ -33,14 +33,6 @@ class OptionsPropertySubgroupTest extends AbstractTestCase
unset($this->object);
}
public function testGetItemType(): void
{
self::assertSame(
'subgroup',
$this->object->getItemType(),
);
}
/**
* Test for
* - PhpMyAdmin\Properties\Options\Groups\OptionsPropertySubgroup::getSubgroupHeader

View File

@ -5,12 +5,6 @@ declare(strict_types=1);
namespace PhpMyAdmin\Tests\Properties\Options\Items;
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\RadioPropertyItem;
use PhpMyAdmin\Properties\Options\Items\SelectPropertyItem;
use PhpMyAdmin\Properties\Options\Items\TextPropertyItem;
use PhpMyAdmin\Tests\AbstractTestCase;
use PHPUnit\Framework\Attributes\CoversNothing;
@ -50,74 +44,4 @@ class PropertyItemsTest extends AbstractTestCase
$object->getName(),
);
}
public function testBoolGetItemType(): void
{
$object = new BoolPropertyItem();
self::assertSame(
'bool',
$object->getItemType(),
);
}
public function testGetItemTypeDoc(): void
{
$object = new DocPropertyItem();
self::assertSame(
'doc',
$object->getItemType(),
);
}
public function testGetItemTypeHidden(): void
{
$object = new HiddenPropertyItem();
self::assertSame(
'hidden',
$object->getItemType(),
);
}
public function testGetItemTypeMessageOnly(): void
{
$object = new MessageOnlyPropertyItem();
self::assertSame(
'messageOnly',
$object->getItemType(),
);
}
public function testGetItemTypeRadio(): void
{
$object = new RadioPropertyItem();
self::assertSame(
'radio',
$object->getItemType(),
);
}
public function testGetItemTypeSelect(): void
{
$object = new SelectPropertyItem();
self::assertSame(
'select',
$object->getItemType(),
);
}
public function testGetItemTypeText(): void
{
$object = new TextPropertyItem();
self::assertSame(
'text',
$object->getItemType(),
);
}
}

View File

@ -22,9 +22,7 @@ class OptionsPropertyGroupTest extends AbstractTestCase
{
parent::setUp();
$this->stub = $this->getMockBuilder(OptionsPropertyGroup::class)
->onlyMethods(['getItemType'])
->getMock();
$this->stub = $this->getMockBuilder(OptionsPropertyGroup::class)->onlyMethods([])->getMock();
}
/**

View File

@ -21,9 +21,7 @@ class OptionsPropertyItemTest extends AbstractTestCase
{
parent::setUp();
$this->stub = $this->getMockBuilder(OptionsPropertyItem::class)
->onlyMethods(['getItemType'])
->getMock();
$this->stub = $this->getMockBuilder(OptionsPropertyItem::class)->onlyMethods([])->getMock();
}
/**
@ -80,12 +78,4 @@ class OptionsPropertyItemTest extends AbstractTestCase
$this->stub->getForce(),
);
}
public function testGetPropertyType(): void
{
self::assertSame(
'options',
$this->stub->getPropertyType(),
);
}
}

View File

@ -21,9 +21,7 @@ class OptionsPropertyOneItemTest extends AbstractTestCase
{
parent::setUp();
$this->stub = $this->getMockBuilder(OptionsPropertyOneItem::class)
->onlyMethods(['getItemType'])
->getMock();
$this->stub = $this->getMockBuilder(OptionsPropertyOneItem::class)->onlyMethods([])->getMock();
}
/**

View File

@ -33,14 +33,6 @@ class ExportPluginPropertiesTest extends AbstractTestCase
unset($this->object);
}
public function testGetItemType(): void
{
self::assertSame(
'export',
$this->object->getItemType(),
);
}
/**
* Test for
* - PhpMyAdmin\Properties\Plugins\ExportPluginProperties::getForceFile

View File

@ -33,14 +33,6 @@ class ImportPluginPropertiesTest extends AbstractTestCase
unset($this->object);
}
public function testGetItemType(): void
{
self::assertSame(
'import',
$this->object->getItemType(),
);
}
/**
* Test for
* - PhpMyAdmin\Properties\Plugins\ImportPluginProperties::getOptionsText

View File

@ -20,9 +20,7 @@ class PluginPropertyItemTest extends AbstractTestCase
{
parent::setUp();
$this->stub = $this->getMockBuilder(PluginPropertyItem::class)
->onlyMethods(['getItemType'])
->getMock();
$this->stub = new PluginPropertyItem();
}
/**
@ -34,12 +32,4 @@ class PluginPropertyItemTest extends AbstractTestCase
unset($this->stub);
}
public function testGetPropertyType(): void
{
self::assertSame(
'plugin',
$this->stub->getPropertyType(),
);
}
}

View File

@ -21,9 +21,7 @@ class PropertyItemTest extends AbstractTestCase
{
parent::setUp();
$this->stub = $this->getMockBuilder(PropertyItem::class)
->onlyMethods(['getItemType', 'getPropertyType'])
->getMock();
$this->stub = $this->getMockBuilder(PropertyItem::class)->getMock();
}
/**