From 86f80af432e0399494384152a3708c411d00a125 Mon Sep 17 00:00:00 2001 From: Philipp Date: Thu, 29 Dec 2022 22:37:12 +0100 Subject: [PATCH] Rename Interface --- src/Console/PostUpdate.php | 6 +++--- ...ICanManageKeyValuePairs.php => IManageKeyValuePairs.php} | 2 +- src/Core/KeyValueStorage/Type/AbstractKeyValueStorage.php | 4 ++-- src/DI.php | 4 ++-- static/dependencies.config.php | 2 +- tests/src/Core/KeyValueStorage/DBKeyValueStorageTest.php | 4 ++-- tests/src/Core/KeyValueStorage/KeyValueStorageTest.php | 6 +++--- 7 files changed, 14 insertions(+), 14 deletions(-) rename src/Core/KeyValueStorage/Capabilities/{ICanManageKeyValuePairs.php => IManageKeyValuePairs.php} (97%) diff --git a/src/Console/PostUpdate.php b/src/Console/PostUpdate.php index cf15fe3e3..702b12710 100644 --- a/src/Console/PostUpdate.php +++ b/src/Console/PostUpdate.php @@ -22,7 +22,7 @@ namespace Friendica\Console; use Friendica\App; -use Friendica\Core\KeyValueStorage\Capabilities\ICanManageKeyValuePairs; +use Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs; use Friendica\Core\L10n; use Friendica\Core\Update; @@ -38,7 +38,7 @@ class PostUpdate extends \Asika\SimpleConsole\Console */ private $appMode; /** - * @var ICanManageKeyValuePairs + * @var IManageKeyValuePairs */ private $keyValue; /** @@ -60,7 +60,7 @@ HELP; return $help; } - public function __construct(App\Mode $appMode, ICanManageKeyValuePairs $keyValue, L10n $l10n, array $argv = null) + public function __construct(App\Mode $appMode, IManageKeyValuePairs $keyValue, L10n $l10n, array $argv = null) { parent::__construct($argv); diff --git a/src/Core/KeyValueStorage/Capabilities/ICanManageKeyValuePairs.php b/src/Core/KeyValueStorage/Capabilities/IManageKeyValuePairs.php similarity index 97% rename from src/Core/KeyValueStorage/Capabilities/ICanManageKeyValuePairs.php rename to src/Core/KeyValueStorage/Capabilities/IManageKeyValuePairs.php index 11c8b772b..64b317bf1 100644 --- a/src/Core/KeyValueStorage/Capabilities/ICanManageKeyValuePairs.php +++ b/src/Core/KeyValueStorage/Capabilities/IManageKeyValuePairs.php @@ -26,7 +26,7 @@ use Friendica\Core\KeyValueStorage\Exceptions\KeyValueStoragePersistenceExceptio /** * Interface for Friendica specific Key-Value pair storage */ -interface ICanManageKeyValuePairs extends \ArrayAccess +interface IManageKeyValuePairs extends \ArrayAccess { /** * Get a particular value from the KeyValue Storage diff --git a/src/Core/KeyValueStorage/Type/AbstractKeyValueStorage.php b/src/Core/KeyValueStorage/Type/AbstractKeyValueStorage.php index cfcebb6ff..169d27f69 100644 --- a/src/Core/KeyValueStorage/Type/AbstractKeyValueStorage.php +++ b/src/Core/KeyValueStorage/Type/AbstractKeyValueStorage.php @@ -21,12 +21,12 @@ namespace Friendica\Core\KeyValueStorage\Type; -use Friendica\Core\KeyValueStorage\Capabilities\ICanManageKeyValuePairs; +use Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs; /** * An abstract helper class for Key-Value storage classes */ -abstract class AbstractKeyValueStorage implements ICanManageKeyValuePairs +abstract class AbstractKeyValueStorage implements IManageKeyValuePairs { /** {@inheritDoc} */ public function get(string $key) diff --git a/src/DI.php b/src/DI.php index a430b0daa..ecdf92530 100644 --- a/src/DI.php +++ b/src/DI.php @@ -181,9 +181,9 @@ abstract class DI return self::$dice->create(Core\Config\Capability\IManageConfigValues::class); } - public static function keyValue(): Core\KeyValueStorage\Capabilities\ICanManageKeyValuePairs + public static function keyValue(): Core\KeyValueStorage\Capabilities\IManageKeyValuePairs { - return self::$dice->create(Core\KeyValueStorage\Capabilities\ICanManageKeyValuePairs::class); + return self::$dice->create(Core\KeyValueStorage\Capabilities\IManageKeyValuePairs::class); } /** diff --git a/static/dependencies.config.php b/static/dependencies.config.php index 645ab968e..116874445 100644 --- a/static/dependencies.config.php +++ b/static/dependencies.config.php @@ -245,7 +245,7 @@ return [ ['getBackend', [], Dice::CHAIN_CALL], ], ], - \Friendica\Core\KeyValueStorage\Capabilities\ICanManageKeyValuePairs::class => [ + \Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs::class => [ 'instanceOf' => \Friendica\Core\KeyValueStorage\Type\DBKeyValueStorage::class, ], Network\HTTPClient\Capability\ICanSendHttpRequests::class => [ diff --git a/tests/src/Core/KeyValueStorage/DBKeyValueStorageTest.php b/tests/src/Core/KeyValueStorage/DBKeyValueStorageTest.php index 967da78a4..1492c3de5 100644 --- a/tests/src/Core/KeyValueStorage/DBKeyValueStorageTest.php +++ b/tests/src/Core/KeyValueStorage/DBKeyValueStorageTest.php @@ -22,7 +22,7 @@ namespace Friendica\Test\src\Core\KeyValueStorage; use Friendica\Core\Config\ValueObject\Cache; -use Friendica\Core\KeyValueStorage\Capabilities\ICanManageKeyValuePairs; +use Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs; use Friendica\Core\KeyValueStorage\Type\DBKeyValueStorage; use Friendica\Database\Database; use Friendica\Database\Definition\DbaDefinition; @@ -53,7 +53,7 @@ class DBKeyValueStorageTest extends KeyValueStorageTest $this->tearDownDb(); } - public function getInstance(): ICanManageKeyValuePairs + public function getInstance(): IManageKeyValuePairs { $cache = new Cache(); $cache->set('database', 'disable_pdo', true); diff --git a/tests/src/Core/KeyValueStorage/KeyValueStorageTest.php b/tests/src/Core/KeyValueStorage/KeyValueStorageTest.php index 6c393310d..b3aee20f5 100644 --- a/tests/src/Core/KeyValueStorage/KeyValueStorageTest.php +++ b/tests/src/Core/KeyValueStorage/KeyValueStorageTest.php @@ -21,18 +21,18 @@ namespace Friendica\Test\src\Core\KeyValueStorage; -use Friendica\Core\KeyValueStorage\Capabilities\ICanManageKeyValuePairs; +use Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs; use Friendica\Test\MockedTest; abstract class KeyValueStorageTest extends MockedTest { - abstract public function getInstance(): ICanManageKeyValuePairs; + abstract public function getInstance(): IManageKeyValuePairs; public function testInstance() { $instance = $this->getInstance(); - self::assertInstanceOf(ICanManageKeyValuePairs::class, $instance); + self::assertInstanceOf(IManageKeyValuePairs::class, $instance); } public function dataTests(): array