]> git.mxchange.org Git - friendica.git/commitdiff
Rename Interface
authorPhilipp <admin@philipp.info>
Thu, 29 Dec 2022 21:37:12 +0000 (22:37 +0100)
committerPhilipp <admin@philipp.info>
Thu, 29 Dec 2022 21:37:12 +0000 (22:37 +0100)
src/Console/PostUpdate.php
src/Core/KeyValueStorage/Capabilities/ICanManageKeyValuePairs.php [deleted file]
src/Core/KeyValueStorage/Capabilities/IManageKeyValuePairs.php [new file with mode: 0644]
src/Core/KeyValueStorage/Type/AbstractKeyValueStorage.php
src/DI.php
static/dependencies.config.php
tests/src/Core/KeyValueStorage/DBKeyValueStorageTest.php
tests/src/Core/KeyValueStorage/KeyValueStorageTest.php

index cf15fe3e393e15a0faa85c5c9a9e0067163ace0d..702b127109dfd996cde792cbbe0fcb8761700c0a 100644 (file)
@@ -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/ICanManageKeyValuePairs.php
deleted file mode 100644 (file)
index 11c8b77..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-namespace Friendica\Core\KeyValueStorage\Capabilities;
-
-use Friendica\Core\KeyValueStorage\Exceptions\KeyValueStoragePersistenceException;
-
-/**
- * Interface for Friendica specific Key-Value pair storage
- */
-interface ICanManageKeyValuePairs extends \ArrayAccess
-{
-       /**
-        * Get a particular value from the KeyValue Storage
-        *
-        * @param string  $key           The key to query
-        *
-        * @return mixed Stored value or null if it does not exist
-        *
-        * @throws KeyValueStoragePersistenceException In case the persistence layer throws errors
-        *
-        */
-       public function get(string $key);
-
-       /**
-        * Sets a value for a given key
-        *
-        * Note: Please do not store booleans - convert to 0/1 integer values!
-        *
-        * @param string $key    The configuration key to set
-        * @param mixed  $value  The value to store
-        *
-        * @throws KeyValueStoragePersistenceException In case the persistence layer throws errors
-        */
-       public function set(string $key, $value): void;
-
-       /**
-        * Deletes the given key.
-        *
-        * @param string $key    The configuration key to delete
-        *
-        * @throws KeyValueStoragePersistenceException In case the persistence layer throws errors
-        *
-        */
-       public function delete(string $key): void;
-}
diff --git a/src/Core/KeyValueStorage/Capabilities/IManageKeyValuePairs.php b/src/Core/KeyValueStorage/Capabilities/IManageKeyValuePairs.php
new file mode 100644 (file)
index 0000000..64b317b
--- /dev/null
@@ -0,0 +1,64 @@
+<?php
+/**
+ * @copyright Copyright (C) 2010-2022, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Core\KeyValueStorage\Capabilities;
+
+use Friendica\Core\KeyValueStorage\Exceptions\KeyValueStoragePersistenceException;
+
+/**
+ * Interface for Friendica specific Key-Value pair storage
+ */
+interface IManageKeyValuePairs extends \ArrayAccess
+{
+       /**
+        * Get a particular value from the KeyValue Storage
+        *
+        * @param string  $key           The key to query
+        *
+        * @return mixed Stored value or null if it does not exist
+        *
+        * @throws KeyValueStoragePersistenceException In case the persistence layer throws errors
+        *
+        */
+       public function get(string $key);
+
+       /**
+        * Sets a value for a given key
+        *
+        * Note: Please do not store booleans - convert to 0/1 integer values!
+        *
+        * @param string $key    The configuration key to set
+        * @param mixed  $value  The value to store
+        *
+        * @throws KeyValueStoragePersistenceException In case the persistence layer throws errors
+        */
+       public function set(string $key, $value): void;
+
+       /**
+        * Deletes the given key.
+        *
+        * @param string $key    The configuration key to delete
+        *
+        * @throws KeyValueStoragePersistenceException In case the persistence layer throws errors
+        *
+        */
+       public function delete(string $key): void;
+}
index cfcebb6ffdf5e04376c3920ad48e3e48b086a9d9..169d27f69b51c802c8aa2a556a9b6c3c6511eb17 100644 (file)
 
 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)
index a430b0daa28f7be445ed12bc212d18bfddc00e17..ecdf92530c41da467129dfa2128267e2a380c3e8 100644 (file)
@@ -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);
        }
 
        /**
index 645ab968eb6a32d497726e6d704aa5284c19b1e6..116874445bf4e502bc4f441abae79a8f4ba358c8 100644 (file)
@@ -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 => [
index 967da78a463e9089cc074567f6ee8632e6db0961..1492c3de51354a17f3043799c9709b4a015114c3 100644 (file)
@@ -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);
index 6c393310d50d7ac53c199f753d652a97539c5af2..b3aee20f594ea5e53b00d04d4bcb7dacaece9c65 100644 (file)
 
 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