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;
*/
private $appMode;
/**
- * @var ICanManageKeyValuePairs
+ * @var IManageKeyValuePairs
*/
private $keyValue;
/**
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);
+++ /dev/null
-<?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;
-}
--- /dev/null
+<?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;
+}
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)
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);
}
/**
['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 => [
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;
$this->tearDownDb();
}
- public function getInstance(): ICanManageKeyValuePairs
+ public function getInstance(): IManageKeyValuePairs
{
$cache = new Cache();
$cache->set('database', 'disable_pdo', true);
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