Drop getItemType() and getPropertyType()
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> 1
This commit is contained in:
parent
4c8dedc303
commit
5e52ee1725
@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
*/
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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
|
||||
*/
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -32,12 +32,4 @@ class OptionsPropertyMainGroupTest extends AbstractTestCase
|
||||
|
||||
unset($this->object);
|
||||
}
|
||||
|
||||
public function testGetItemType(): void
|
||||
{
|
||||
self::assertSame(
|
||||
'main',
|
||||
$this->object->getItemType(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
*/
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -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(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user