From 9f18222a061342e3587ee6f38c4543d00948c0b8 Mon Sep 17 00:00:00 2001 From: Philipp Date: Sun, 23 Jul 2023 03:21:41 +0200 Subject: [PATCH] Unify "Capability" --- bin/auth_ejabberd.php | 6 +++--- bin/console.php | 6 +++--- bin/daemon.php | 6 +++--- bin/worker.php | 6 +++--- doc/StrategyHooks.md | 12 ++++++------ index.php | 4 ++-- src/Console/PostUpdate.php | 2 +- src/Content/Item.php | 2 +- .../{Capabilities => Capability}/ICanLoadAddons.php | 2 +- src/Core/Addon/Model/AddonLoader.php | 2 +- src/Core/Cache/Factory/Cache.php | 2 +- .../BehavioralHookType.php | 2 +- .../ICanCreateInstances.php | 2 +- .../ICanRegisterStrategies.php | 2 +- src/Core/Hooks/Model/DiceInstanceManager.php | 4 ++-- src/Core/Hooks/Util/StrategiesFileManager.php | 4 ++-- .../IManageKeyValuePairs.php | 2 +- src/Core/KeyValueStorage/Factory/KeyValueStorage.php | 4 ++-- .../KeyValueStorage/Type/AbstractKeyValueStorage.php | 2 +- .../ICheckLoggerSettings.php | 2 +- .../IHaveCallIntrospections.php | 2 +- .../{Capabilities => Capability}/LogChannel.php | 2 +- .../Logger/Factory/AbstractLoggerTypeFactory.php | 2 +- src/Core/Logger/Factory/Logger.php | 4 ++-- src/Core/Logger/Factory/StreamLogger.php | 2 +- src/Core/Logger/Type/AbstractLogger.php | 2 +- src/Core/Logger/Type/StreamLogger.php | 2 +- src/Core/Logger/Type/SyslogLogger.php | 2 +- src/Core/Logger/Util/Introspection.php | 2 +- src/Core/Logger/Util/LoggerSettingsCheck.php | 2 +- src/Core/PConfig/Factory/PConfig.php | 2 +- src/DI.php | 6 +++--- src/Module/Friendica.php | 2 +- src/Module/Statistics.php | 4 ++-- static/dependencies.config.php | 12 ++++++------ static/strategies.config.php | 4 ++-- tests/src/Core/Addon/Model/AddonLoaderTest.php | 8 ++++---- .../Core/Hooks/Util/StrategiesFileManagerTest.php | 4 ++-- .../Core/KeyValueStorage/DBKeyValueStorageTest.php | 2 +- .../src/Core/KeyValueStorage/KeyValueStorageTest.php | 2 +- tests/src/Core/Logger/SyslogLoggerWrapper.php | 2 +- 41 files changed, 72 insertions(+), 72 deletions(-) rename src/Core/Addon/{Capabilities => Capability}/ICanLoadAddons.php (96%) rename src/Core/Hooks/{Capabilities => Capability}/BehavioralHookType.php (96%) rename src/Core/Hooks/{Capabilities => Capability}/ICanCreateInstances.php (97%) rename src/Core/Hooks/{Capabilities => Capability}/ICanRegisterStrategies.php (97%) rename src/Core/KeyValueStorage/{Capabilities => Capability}/IManageKeyValuePairs.php (97%) rename src/Core/Logger/{Capabilities => Capability}/ICheckLoggerSettings.php (96%) rename src/Core/Logger/{Capabilities => Capability}/IHaveCallIntrospections.php (96%) rename src/Core/Logger/{Capabilities => Capability}/LogChannel.php (97%) diff --git a/bin/auth_ejabberd.php b/bin/auth_ejabberd.php index b923009e64..3a95532464 100755 --- a/bin/auth_ejabberd.php +++ b/bin/auth_ejabberd.php @@ -58,7 +58,7 @@ if (php_sapi_name() !== 'cli') { use Dice\Dice; use Friendica\App\Mode; -use Friendica\Core\Logger\Capabilities\LogChannel; +use Friendica\Core\Logger\Capability\LogChannel; use Friendica\Security\ExAuth; use Psr\Log\LoggerInterface; @@ -79,8 +79,8 @@ chdir($directory); require dirname(__DIR__) . '/vendor/autoload.php'; $dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php'); -/** @var \Friendica\Core\Addon\Capabilities\ICanLoadAddons $addonLoader */ -$addonLoader = $dice->create(\Friendica\Core\Addon\Capabilities\ICanLoadAddons::class); +/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */ +$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class); $dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies')); $dice = $dice->addRule(LoggerInterface::class,['constructParams' => [LogChannel::AUTH_JABBERED]]); diff --git a/bin/console.php b/bin/console.php index b2cde10823..b797e6ba99 100755 --- a/bin/console.php +++ b/bin/console.php @@ -26,15 +26,15 @@ if (php_sapi_name() !== 'cli') { } use Dice\Dice; -use Friendica\Core\Logger\Capabilities\LogChannel; +use Friendica\Core\Logger\Capability\LogChannel; use Friendica\DI; use Psr\Log\LoggerInterface; require dirname(__DIR__) . '/vendor/autoload.php'; $dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php'); -/** @var \Friendica\Core\Addon\Capabilities\ICanLoadAddons $addonLoader */ -$addonLoader = $dice->create(\Friendica\Core\Addon\Capabilities\ICanLoadAddons::class); +/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */ +$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class); $dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies')); $dice = $dice->addRule(LoggerInterface::class, ['constructParams' => [LogChannel::CONSOLE]]); diff --git a/bin/daemon.php b/bin/daemon.php index 11bad2b11a..cd774fe25e 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -60,10 +60,10 @@ if (!file_exists('index.php') && (sizeof($_SERVER['argv']) != 0)) { require dirname(__DIR__) . '/vendor/autoload.php'; $dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php'); -/** @var \Friendica\Core\Addon\Capabilities\ICanLoadAddons $addonLoader */ -$addonLoader = $dice->create(\Friendica\Core\Addon\Capabilities\ICanLoadAddons::class); +/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */ +$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class); $dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies')); -$dice = $dice->addRule(LoggerInterface::class, ['constructParams' => [Logger\Capabilities\LogChannel::DAEMON]]); +$dice = $dice->addRule(LoggerInterface::class, ['constructParams' => [Logger\Capability\LogChannel::DAEMON]]); DI::init($dice); \Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class)); diff --git a/bin/worker.php b/bin/worker.php index 42a8f533d3..c855f9bc55 100755 --- a/bin/worker.php +++ b/bin/worker.php @@ -29,7 +29,7 @@ if (php_sapi_name() !== 'cli') { use Dice\Dice; use Friendica\App; use Friendica\App\Mode; -use Friendica\Core\Logger\Capabilities\LogChannel; +use Friendica\Core\Logger\Capability\LogChannel; use Friendica\Core\Update; use Friendica\Core\Worker; use Friendica\DI; @@ -55,8 +55,8 @@ if (!file_exists("index.php") && (sizeof($_SERVER["argv"]) != 0)) { require dirname(__DIR__) . '/vendor/autoload.php'; $dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php'); -/** @var \Friendica\Core\Addon\Capabilities\ICanLoadAddons $addonLoader */ -$addonLoader = $dice->create(\Friendica\Core\Addon\Capabilities\ICanLoadAddons::class); +/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */ +$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class); $dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies')); $dice = $dice->addRule(LoggerInterface::class, ['constructParams' => [LogChannel::WORKER]]); diff --git a/doc/StrategyHooks.md b/doc/StrategyHooks.md index 39fc1bd8df..2960ceeaad 100644 --- a/doc/StrategyHooks.md +++ b/doc/StrategyHooks.md @@ -10,9 +10,9 @@ This type of hook is based on the [Strategy Design Pattern](https://refactoring. A strategy class defines a possible implementation of a given interface based on a unique name. Every name is possible as long as it's unique and not `null`. Using an empty name (`''`) is possible as well and should be used as the "default" implementation. -To register a strategy, use the [`ICanRegisterInstance`](../src/Core/Hooks/Capabilities/ICanRegisterInstances.php) interface. +To register a strategy, use the [`ICanRegisterInstance`](../src/Core/Hooks/Capability/ICanRegisterInstances.php) interface. -After registration, a caller can automatically create this instance with the [`ICanCreateInstances`](../src/Core/Hooks/Capabilities/ICanCreateInstances.php) interface and the chosen name. +After registration, a caller can automatically create this instance with the [`ICanCreateInstances`](../src/Core/Hooks/Capability/ICanCreateInstances.php) interface and the chosen name. This is useful in case there are different, possible implementations for the same purpose, like for logging, locking, caching, ... @@ -43,11 +43,11 @@ public class ConcreteClassB implements ExampleInterface } } -/** @var \Friendica\Core\Hooks\Capabilities\ICanRegisterStrategies $instanceRegister */ +/** @var \Friendica\Core\Hooks\Capability\ICanRegisterStrategies $instanceRegister */ $instanceRegister->registerStrategy(ExampleInterface::class, ConcreteClassA::class, 'A'); $instanceRegister->registerStrategy(ExampleInterface::class, ConcreteClassB::class, 'B'); -/** @var \Friendica\Core\Hooks\Capabilities\ICanCreateInstances $instanceManager */ +/** @var \Friendica\Core\Hooks\Capability\ICanCreateInstances $instanceManager */ /** @var ConcreteClassA $concreteClass */ $concreteClass = $instanceManager->create(ExampleInterface::class, 'A'); @@ -62,14 +62,14 @@ To avoid registering all strategies manually inside the code, Friendica introduc There, you can register all kind of strategies in one file. -### [`HookType::STRATEGY`](../src/Core/Hooks/Capabilities/HookType.php) +### [`HookType::STRATEGY`](../src/Core/Hooks/Capability/HookType.php) For each given interface, a list of key-value pairs can be set, where the key is the concrete implementation class and the value is an array of unique names. ### Example ```php -use Friendica\Core\Hooks\Capabilities\BehavioralHookType as H; +use Friendica\Core\Hooks\Capability\BehavioralHookType as H; return [ H::STRATEGY => [ diff --git a/index.php b/index.php index ce82470b64..87778308a5 100644 --- a/index.php +++ b/index.php @@ -30,8 +30,8 @@ if (!file_exists(__DIR__ . '/vendor/autoload.php')) { require __DIR__ . '/vendor/autoload.php'; $dice = (new Dice())->addRules(include __DIR__ . '/static/dependencies.config.php'); -/** @var \Friendica\Core\Addon\Capabilities\ICanLoadAddons $addonLoader */ -$addonLoader = $dice->create(\Friendica\Core\Addon\Capabilities\ICanLoadAddons::class); +/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */ +$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class); $dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies')); $dice = $dice->addRule(Friendica\App\Mode::class, ['call' => [['determineRunMode', [false, $_SERVER], Dice::CHAIN_CALL]]]); diff --git a/src/Console/PostUpdate.php b/src/Console/PostUpdate.php index 742197e732..42cc63e109 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\IManageKeyValuePairs; +use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs; use Friendica\Core\L10n; use Friendica\Core\Update; diff --git a/src/Content/Item.php b/src/Content/Item.php index f7dda6c65f..c25e5296f0 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -544,7 +544,7 @@ class Item unset($item['owner-name']); unset($item['owner-avatar']); } - + $item['postopts'] = ''; } diff --git a/src/Core/Addon/Capabilities/ICanLoadAddons.php b/src/Core/Addon/Capability/ICanLoadAddons.php similarity index 96% rename from src/Core/Addon/Capabilities/ICanLoadAddons.php rename to src/Core/Addon/Capability/ICanLoadAddons.php index 9c9d1e841c..42af1a7b37 100644 --- a/src/Core/Addon/Capabilities/ICanLoadAddons.php +++ b/src/Core/Addon/Capability/ICanLoadAddons.php @@ -19,7 +19,7 @@ * */ -namespace Friendica\Core\Addon\Capabilities; +namespace Friendica\Core\Addon\Capability; /** * Interface for loading Addons specific content diff --git a/src/Core/Addon/Model/AddonLoader.php b/src/Core/Addon/Model/AddonLoader.php index 952246af0a..e808f21777 100644 --- a/src/Core/Addon/Model/AddonLoader.php +++ b/src/Core/Addon/Model/AddonLoader.php @@ -21,7 +21,7 @@ namespace Friendica\Core\Addon\Model; -use Friendica\Core\Addon\Capabilities\ICanLoadAddons; +use Friendica\Core\Addon\Capability\ICanLoadAddons; use Friendica\Core\Addon\Exception\AddonInvalidConfigFileException; use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Util\Strings; diff --git a/src/Core/Cache/Factory/Cache.php b/src/Core/Cache/Factory/Cache.php index b6124c156d..02cdb1a79e 100644 --- a/src/Core/Cache/Factory/Cache.php +++ b/src/Core/Cache/Factory/Cache.php @@ -27,7 +27,7 @@ use Friendica\Core\Cache\Exception\CachePersistenceException; use Friendica\Core\Cache\Exception\InvalidCacheDriverException; use Friendica\Core\Cache\Type; use Friendica\Core\Config\Capability\IManageConfigValues; -use Friendica\Core\Hooks\Capabilities\ICanCreateInstances; +use Friendica\Core\Hooks\Capability\ICanCreateInstances; use Friendica\Util\Profiler; /** diff --git a/src/Core/Hooks/Capabilities/BehavioralHookType.php b/src/Core/Hooks/Capability/BehavioralHookType.php similarity index 96% rename from src/Core/Hooks/Capabilities/BehavioralHookType.php rename to src/Core/Hooks/Capability/BehavioralHookType.php index 6336406e63..6de875e557 100644 --- a/src/Core/Hooks/Capabilities/BehavioralHookType.php +++ b/src/Core/Hooks/Capability/BehavioralHookType.php @@ -19,7 +19,7 @@ * */ -namespace Friendica\Core\Hooks\Capabilities; +namespace Friendica\Core\Hooks\Capability; /** * An enum of hook types, based on behavioral design patterns diff --git a/src/Core/Hooks/Capabilities/ICanCreateInstances.php b/src/Core/Hooks/Capability/ICanCreateInstances.php similarity index 97% rename from src/Core/Hooks/Capabilities/ICanCreateInstances.php rename to src/Core/Hooks/Capability/ICanCreateInstances.php index 77d4c4b366..55740d2767 100644 --- a/src/Core/Hooks/Capabilities/ICanCreateInstances.php +++ b/src/Core/Hooks/Capability/ICanCreateInstances.php @@ -19,7 +19,7 @@ * */ -namespace Friendica\Core\Hooks\Capabilities; +namespace Friendica\Core\Hooks\Capability; /** * creates special instances for given classes diff --git a/src/Core/Hooks/Capabilities/ICanRegisterStrategies.php b/src/Core/Hooks/Capability/ICanRegisterStrategies.php similarity index 97% rename from src/Core/Hooks/Capabilities/ICanRegisterStrategies.php rename to src/Core/Hooks/Capability/ICanRegisterStrategies.php index 911eb3499f..875665764f 100644 --- a/src/Core/Hooks/Capabilities/ICanRegisterStrategies.php +++ b/src/Core/Hooks/Capability/ICanRegisterStrategies.php @@ -19,7 +19,7 @@ * */ -namespace Friendica\Core\Hooks\Capabilities; +namespace Friendica\Core\Hooks\Capability; use Friendica\Core\Hooks\Exceptions\HookRegisterArgumentException; diff --git a/src/Core/Hooks/Model/DiceInstanceManager.php b/src/Core/Hooks/Model/DiceInstanceManager.php index a8b0b540ce..194fc6e5c7 100644 --- a/src/Core/Hooks/Model/DiceInstanceManager.php +++ b/src/Core/Hooks/Model/DiceInstanceManager.php @@ -22,8 +22,8 @@ namespace Friendica\Core\Hooks\Model; use Dice\Dice; -use Friendica\Core\Hooks\Capabilities\ICanCreateInstances; -use Friendica\Core\Hooks\Capabilities\ICanRegisterStrategies; +use Friendica\Core\Hooks\Capability\ICanCreateInstances; +use Friendica\Core\Hooks\Capability\ICanRegisterStrategies; use Friendica\Core\Hooks\Exceptions\HookInstanceException; use Friendica\Core\Hooks\Exceptions\HookRegisterArgumentException; use Friendica\Core\Hooks\Util\StrategiesFileManager; diff --git a/src/Core/Hooks/Util/StrategiesFileManager.php b/src/Core/Hooks/Util/StrategiesFileManager.php index 700c401f2b..d6651ac981 100644 --- a/src/Core/Hooks/Util/StrategiesFileManager.php +++ b/src/Core/Hooks/Util/StrategiesFileManager.php @@ -21,8 +21,8 @@ namespace Friendica\Core\Hooks\Util; -use Friendica\Core\Addon\Capabilities\ICanLoadAddons; -use Friendica\Core\Hooks\Capabilities\ICanRegisterStrategies; +use Friendica\Core\Addon\Capability\ICanLoadAddons; +use Friendica\Core\Hooks\Capability\ICanRegisterStrategies; use Friendica\Core\Hooks\Exceptions\HookConfigException; /** diff --git a/src/Core/KeyValueStorage/Capabilities/IManageKeyValuePairs.php b/src/Core/KeyValueStorage/Capability/IManageKeyValuePairs.php similarity index 97% rename from src/Core/KeyValueStorage/Capabilities/IManageKeyValuePairs.php rename to src/Core/KeyValueStorage/Capability/IManageKeyValuePairs.php index c9d215c49c..5d9c8455ee 100644 --- a/src/Core/KeyValueStorage/Capabilities/IManageKeyValuePairs.php +++ b/src/Core/KeyValueStorage/Capability/IManageKeyValuePairs.php @@ -19,7 +19,7 @@ * */ -namespace Friendica\Core\KeyValueStorage\Capabilities; +namespace Friendica\Core\KeyValueStorage\Capability; use Friendica\Core\KeyValueStorage\Exceptions\KeyValueStoragePersistenceException; diff --git a/src/Core/KeyValueStorage/Factory/KeyValueStorage.php b/src/Core/KeyValueStorage/Factory/KeyValueStorage.php index 1bce84f4e6..ee6cb17318 100644 --- a/src/Core/KeyValueStorage/Factory/KeyValueStorage.php +++ b/src/Core/KeyValueStorage/Factory/KeyValueStorage.php @@ -21,8 +21,8 @@ namespace Friendica\Core\KeyValueStorage\Factory; -use Friendica\Core\Hooks\Capabilities\ICanCreateInstances; -use Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs; +use Friendica\Core\Hooks\Capability\ICanCreateInstances; +use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs; class KeyValueStorage { diff --git a/src/Core/KeyValueStorage/Type/AbstractKeyValueStorage.php b/src/Core/KeyValueStorage/Type/AbstractKeyValueStorage.php index a6924b61f5..6b16665276 100644 --- a/src/Core/KeyValueStorage/Type/AbstractKeyValueStorage.php +++ b/src/Core/KeyValueStorage/Type/AbstractKeyValueStorage.php @@ -21,7 +21,7 @@ namespace Friendica\Core\KeyValueStorage\Type; -use Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs; +use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs; /** * An abstract helper class for Key-Value storage classes diff --git a/src/Core/Logger/Capabilities/ICheckLoggerSettings.php b/src/Core/Logger/Capability/ICheckLoggerSettings.php similarity index 96% rename from src/Core/Logger/Capabilities/ICheckLoggerSettings.php rename to src/Core/Logger/Capability/ICheckLoggerSettings.php index fb93d18e80..abdbc3b50a 100644 --- a/src/Core/Logger/Capabilities/ICheckLoggerSettings.php +++ b/src/Core/Logger/Capability/ICheckLoggerSettings.php @@ -19,7 +19,7 @@ * */ -namespace Friendica\Core\Logger\Capabilities; +namespace Friendica\Core\Logger\Capability; /** * Whenever a logging specific check is necessary, use this interface to encapsulate and centralize this logic diff --git a/src/Core/Logger/Capabilities/IHaveCallIntrospections.php b/src/Core/Logger/Capability/IHaveCallIntrospections.php similarity index 96% rename from src/Core/Logger/Capabilities/IHaveCallIntrospections.php rename to src/Core/Logger/Capability/IHaveCallIntrospections.php index 83d75f976f..918232af39 100644 --- a/src/Core/Logger/Capabilities/IHaveCallIntrospections.php +++ b/src/Core/Logger/Capability/IHaveCallIntrospections.php @@ -19,7 +19,7 @@ * */ -namespace Friendica\Core\Logger\Capabilities; +namespace Friendica\Core\Logger\Capability; interface IHaveCallIntrospections { diff --git a/src/Core/Logger/Capabilities/LogChannel.php b/src/Core/Logger/Capability/LogChannel.php similarity index 97% rename from src/Core/Logger/Capabilities/LogChannel.php rename to src/Core/Logger/Capability/LogChannel.php index 31915168b9..c3b6316440 100644 --- a/src/Core/Logger/Capabilities/LogChannel.php +++ b/src/Core/Logger/Capability/LogChannel.php @@ -19,7 +19,7 @@ * */ -namespace Friendica\Core\Logger\Capabilities; +namespace Friendica\Core\Logger\Capability; /** * An enum class for the Log channels diff --git a/src/Core/Logger/Factory/AbstractLoggerTypeFactory.php b/src/Core/Logger/Factory/AbstractLoggerTypeFactory.php index 402176d8e6..86dfeae63b 100644 --- a/src/Core/Logger/Factory/AbstractLoggerTypeFactory.php +++ b/src/Core/Logger/Factory/AbstractLoggerTypeFactory.php @@ -21,7 +21,7 @@ namespace Friendica\Core\Logger\Factory; -use Friendica\Core\Logger\Capabilities\IHaveCallIntrospections; +use Friendica\Core\Logger\Capability\IHaveCallIntrospections; use Psr\Log\LogLevel; /** diff --git a/src/Core/Logger/Factory/Logger.php b/src/Core/Logger/Factory/Logger.php index c370cc4dd7..f1086f5853 100644 --- a/src/Core/Logger/Factory/Logger.php +++ b/src/Core/Logger/Factory/Logger.php @@ -22,8 +22,8 @@ namespace Friendica\Core\Logger\Factory; use Friendica\Core\Config\Capability\IManageConfigValues; -use Friendica\Core\Hooks\Capabilities\ICanCreateInstances; -use Friendica\Core\Logger\Capabilities\LogChannel; +use Friendica\Core\Hooks\Capability\ICanCreateInstances; +use Friendica\Core\Logger\Capability\LogChannel; use Friendica\Core\Logger\Type\ProfilerLogger as ProfilerLoggerClass; use Friendica\Util\Profiler; use Psr\Log\LoggerInterface; diff --git a/src/Core/Logger/Factory/StreamLogger.php b/src/Core/Logger/Factory/StreamLogger.php index caad78e3b4..7f32d66b1d 100644 --- a/src/Core/Logger/Factory/StreamLogger.php +++ b/src/Core/Logger/Factory/StreamLogger.php @@ -22,7 +22,7 @@ namespace Friendica\Core\Logger\Factory; use Friendica\Core\Config\Capability\IManageConfigValues; -use Friendica\Core\Logger\Capabilities\LogChannel; +use Friendica\Core\Logger\Capability\LogChannel; use Friendica\Core\Logger\Exception\LoggerArgumentException; use Friendica\Core\Logger\Exception\LoggerException; use Friendica\Core\Logger\Exception\LogLevelException; diff --git a/src/Core/Logger/Type/AbstractLogger.php b/src/Core/Logger/Type/AbstractLogger.php index 77a61e9206..e592ee86d6 100644 --- a/src/Core/Logger/Type/AbstractLogger.php +++ b/src/Core/Logger/Type/AbstractLogger.php @@ -21,7 +21,7 @@ namespace Friendica\Core\Logger\Type; -use Friendica\Core\Logger\Capabilities\IHaveCallIntrospections; +use Friendica\Core\Logger\Capability\IHaveCallIntrospections; use Friendica\Core\Logger\Exception\LoggerException; use Friendica\Util\Strings; use Psr\Log\LoggerInterface; diff --git a/src/Core/Logger/Type/StreamLogger.php b/src/Core/Logger/Type/StreamLogger.php index 87f1a3937f..e09a320473 100644 --- a/src/Core/Logger/Type/StreamLogger.php +++ b/src/Core/Logger/Type/StreamLogger.php @@ -21,7 +21,7 @@ namespace Friendica\Core\Logger\Type; -use Friendica\Core\Logger\Capabilities\IHaveCallIntrospections; +use Friendica\Core\Logger\Capability\IHaveCallIntrospections; use Friendica\Core\Logger\Exception\LoggerException; use Friendica\Core\Logger\Exception\LogLevelException; use Friendica\Util\DateTimeFormat; diff --git a/src/Core/Logger/Type/SyslogLogger.php b/src/Core/Logger/Type/SyslogLogger.php index 88dc1964dd..fb8cb97ae7 100644 --- a/src/Core/Logger/Type/SyslogLogger.php +++ b/src/Core/Logger/Type/SyslogLogger.php @@ -21,7 +21,7 @@ namespace Friendica\Core\Logger\Type; -use Friendica\Core\Logger\Capabilities\IHaveCallIntrospections; +use Friendica\Core\Logger\Capability\IHaveCallIntrospections; use Friendica\Core\Logger\Exception\LoggerException; use Friendica\Core\Logger\Exception\LogLevelException; use Psr\Log\LogLevel; diff --git a/src/Core/Logger/Util/Introspection.php b/src/Core/Logger/Util/Introspection.php index e0f7e85540..0b703da825 100644 --- a/src/Core/Logger/Util/Introspection.php +++ b/src/Core/Logger/Util/Introspection.php @@ -22,7 +22,7 @@ namespace Friendica\Core\Logger\Util; use Friendica\App\Request; -use Friendica\Core\Logger\Capabilities\IHaveCallIntrospections; +use Friendica\Core\Logger\Capability\IHaveCallIntrospections; /** * Get Introspection information about the current call diff --git a/src/Core/Logger/Util/LoggerSettingsCheck.php b/src/Core/Logger/Util/LoggerSettingsCheck.php index 7782216dab..cb598d5f2d 100644 --- a/src/Core/Logger/Util/LoggerSettingsCheck.php +++ b/src/Core/Logger/Util/LoggerSettingsCheck.php @@ -23,7 +23,7 @@ namespace Friendica\Core\Logger\Util; use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\L10n; -use Friendica\Core\Logger\Capabilities\ICheckLoggerSettings; +use Friendica\Core\Logger\Capability\ICheckLoggerSettings; use Friendica\Core\Logger\Exception\LoggerUnusableException; /** {@inheritDoc} */ diff --git a/src/Core/PConfig/Factory/PConfig.php b/src/Core/PConfig/Factory/PConfig.php index 4195619bc2..0596752899 100644 --- a/src/Core/PConfig/Factory/PConfig.php +++ b/src/Core/PConfig/Factory/PConfig.php @@ -22,7 +22,7 @@ namespace Friendica\Core\PConfig\Factory; use Friendica\Core\Config\Capability\IManageConfigValues; -use Friendica\Core\Hooks\Capabilities\ICanCreateInstances; +use Friendica\Core\Hooks\Capability\ICanCreateInstances; use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues; class PConfig diff --git a/src/DI.php b/src/DI.php index 1917f710d3..34cf1c68d5 100644 --- a/src/DI.php +++ b/src/DI.php @@ -22,7 +22,7 @@ namespace Friendica; use Dice\Dice; -use Friendica\Core\Logger\Capabilities\ICheckLoggerSettings; +use Friendica\Core\Logger\Capability\ICheckLoggerSettings; use Friendica\Core\Logger\Util\LoggerSettingsCheck; use Friendica\Core\Session\Capability\IHandleSessions; use Friendica\Core\Session\Capability\IHandleUserSessions; @@ -210,9 +210,9 @@ abstract class DI return self::$dice->create(Core\Config\Util\ConfigFileManager::class); } - public static function keyValue(): Core\KeyValueStorage\Capabilities\IManageKeyValuePairs + public static function keyValue(): Core\KeyValueStorage\Capability\IManageKeyValuePairs { - return self::$dice->create(Core\KeyValueStorage\Capabilities\IManageKeyValuePairs::class); + return self::$dice->create(Core\KeyValueStorage\Capability\IManageKeyValuePairs::class); } /** diff --git a/src/Module/Friendica.php b/src/Module/Friendica.php index c6e2768bd3..1bd6bd411e 100644 --- a/src/Module/Friendica.php +++ b/src/Module/Friendica.php @@ -26,7 +26,7 @@ use Friendica\BaseModule; use Friendica\Core\Addon; use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Hook; -use Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs; +use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs; use Friendica\Core\L10n; use Friendica\Core\Renderer; use Friendica\Core\Session\Capability\IHandleUserSessions; diff --git a/src/Module/Statistics.php b/src/Module/Statistics.php index 514f10bb73..e69f754216 100644 --- a/src/Module/Statistics.php +++ b/src/Module/Statistics.php @@ -25,7 +25,7 @@ use Friendica\App; use Friendica\BaseModule; use Friendica\Core\Addon; use Friendica\Core\Config\Capability\IManageConfigValues; -use Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs; +use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs; use Friendica\Core\L10n; use Friendica\Core\System; use Friendica\Network\HTTPException\NotFoundException; @@ -38,7 +38,7 @@ class Statistics extends BaseModule protected $config; /** @var IManageKeyValuePairs */ protected $keyValue; - + public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, IManageConfigValues $config, IManageKeyValuePairs $keyValue, Response $response, array $server, array $parameters = []) { parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); diff --git a/static/dependencies.config.php b/static/dependencies.config.php index 9c1ead9053..3dfde6b5f4 100644 --- a/static/dependencies.config.php +++ b/static/dependencies.config.php @@ -37,8 +37,8 @@ use Dice\Dice; use Friendica\App; use Friendica\Core\Cache; use Friendica\Core\Config; -use Friendica\Core\Hooks\Capabilities\ICanCreateInstances; -use Friendica\Core\Hooks\Capabilities\ICanRegisterStrategies; +use Friendica\Core\Hooks\Capability\ICanCreateInstances; +use Friendica\Core\Hooks\Capability\ICanRegisterStrategies; use Friendica\Core\Hooks\Model\DiceInstanceManager; use Friendica\Core\PConfig; use Friendica\Core\L10n; @@ -63,7 +63,7 @@ return [ // one instance for the whole execution 'shared' => true, ], - \Friendica\Core\Addon\Capabilities\ICanLoadAddons::class => [ + \Friendica\Core\Addon\Capability\ICanLoadAddons::class => [ 'instanceOf' => \Friendica\Core\Addon\Model\AddonLoader::class, 'constructParams' => [ [Dice::INSTANCE => '$basepath'], @@ -215,10 +215,10 @@ return [ ['create', [], Dice::CHAIN_CALL], ], ], - \Friendica\Core\Logger\Capabilities\IHaveCallIntrospections::class => [ + \Friendica\Core\Logger\Capability\IHaveCallIntrospections::class => [ 'instanceOf' => \Friendica\Core\Logger\Util\Introspection::class, 'constructParams' => [ - \Friendica\Core\Logger\Capabilities\IHaveCallIntrospections::IGNORE_CLASS_LIST, + \Friendica\Core\Logger\Capability\IHaveCallIntrospections::IGNORE_CLASS_LIST, ], ], '$devLogger' => [ @@ -290,7 +290,7 @@ return [ ['getBackend', [], Dice::CHAIN_CALL], ], ], - \Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs::class => [ + \Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs::class => [ 'instanceOf' => \Friendica\Core\KeyValueStorage\Factory\KeyValueStorage::class, 'call' => [ ['create', [], Dice::CHAIN_CALL], diff --git a/static/strategies.config.php b/static/strategies.config.php index 339a59a878..8df0c04788 100644 --- a/static/strategies.config.php +++ b/static/strategies.config.php @@ -38,11 +38,11 @@ return [ Cache\Type\MemcachedCache::class => ['memcached'], Cache\Type\RedisCache::class => ['redis'], ], - KeyValueStorage\Capabilities\IManageKeyValuePairs::class => [ + KeyValueStorage\Capability\IManageKeyValuePairs::class => [ KeyValueStorage\Type\DBKeyValueStorage::class => ['database', ''], ], PConfig\Capability\IManagePersonalConfigValues::class => [ - PConfig\Type\JitPConfig::class => ['jit'], + PConfig\Type\JitPConfig::class => ['jit'], PConfig\Type\PreloadPConfig::class => ['preload', ''], ], ]; diff --git a/tests/src/Core/Addon/Model/AddonLoaderTest.php b/tests/src/Core/Addon/Model/AddonLoaderTest.php index 189110fded..f49333b32d 100644 --- a/tests/src/Core/Addon/Model/AddonLoaderTest.php +++ b/tests/src/Core/Addon/Model/AddonLoaderTest.php @@ -54,7 +54,7 @@ class AddonLoaderTest extends MockedTest [ + \Friendica\Core\Hooks\Capability\BehavioralHookType::STRATEGY => [ \Psr\Log\LoggerInterface::class => [ \Psr\Log\NullLogger::class => [''], ], @@ -79,7 +79,7 @@ EOF; 'addon/testaddon1/static/hooks.config.php' => $this->content, ], 'assertion' => [ - \Friendica\Core\Hooks\Capabilities\BehavioralHookType::STRATEGY => [ + \Friendica\Core\Hooks\Capability\BehavioralHookType::STRATEGY => [ \Psr\Log\LoggerInterface::class => [ \Psr\Log\NullLogger::class => [''], ], @@ -94,7 +94,7 @@ EOF; 'addon/testaddon2/static/hooks.config.php' => $this->content, ], 'assertion' => [ - \Friendica\Core\Hooks\Capabilities\BehavioralHookType::STRATEGY => [ + \Friendica\Core\Hooks\Capability\BehavioralHookType::STRATEGY => [ \Psr\Log\LoggerInterface::class => [ \Psr\Log\NullLogger::class => ['', ''], ], @@ -118,7 +118,7 @@ EOF; 'addon/testaddon2/static/hooks.config.php' => $this->content, ], 'assertion' => [ - \Friendica\Core\Hooks\Capabilities\BehavioralHookType::STRATEGY => [ + \Friendica\Core\Hooks\Capability\BehavioralHookType::STRATEGY => [ \Psr\Log\LoggerInterface::class => [ \Psr\Log\NullLogger::class => [''], ], diff --git a/tests/src/Core/Hooks/Util/StrategiesFileManagerTest.php b/tests/src/Core/Hooks/Util/StrategiesFileManagerTest.php index 592f6f1e06..ebb213fa7b 100644 --- a/tests/src/Core/Hooks/Util/StrategiesFileManagerTest.php +++ b/tests/src/Core/Hooks/Util/StrategiesFileManagerTest.php @@ -21,8 +21,8 @@ namespace Friendica\Test\src\Core\Hooks\Util; -use Friendica\Core\Addon\Capabilities\ICanLoadAddons; -use Friendica\Core\Hooks\Capabilities\ICanRegisterStrategies; +use Friendica\Core\Addon\Capability\ICanLoadAddons; +use Friendica\Core\Hooks\Capability\ICanRegisterStrategies; use Friendica\Core\Hooks\Exceptions\HookConfigException; use Friendica\Core\Hooks\Util\StrategiesFileManager; use Friendica\Test\MockedTest; diff --git a/tests/src/Core/KeyValueStorage/DBKeyValueStorageTest.php b/tests/src/Core/KeyValueStorage/DBKeyValueStorageTest.php index 80a0f16de0..3a3b255365 100644 --- a/tests/src/Core/KeyValueStorage/DBKeyValueStorageTest.php +++ b/tests/src/Core/KeyValueStorage/DBKeyValueStorageTest.php @@ -21,7 +21,7 @@ namespace Friendica\Test\src\Core\KeyValueStorage; -use Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs; +use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs; use Friendica\Core\KeyValueStorage\Type\DBKeyValueStorage; use Friendica\Database\Database; use Friendica\Test\Util\CreateDatabaseTrait; diff --git a/tests/src/Core/KeyValueStorage/KeyValueStorageTest.php b/tests/src/Core/KeyValueStorage/KeyValueStorageTest.php index 6ccc0f5f4d..ddb0acc4dc 100644 --- a/tests/src/Core/KeyValueStorage/KeyValueStorageTest.php +++ b/tests/src/Core/KeyValueStorage/KeyValueStorageTest.php @@ -21,7 +21,7 @@ namespace Friendica\Test\src\Core\KeyValueStorage; -use Friendica\Core\KeyValueStorage\Capabilities\IManageKeyValuePairs; +use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs; use Friendica\Test\MockedTest; abstract class KeyValueStorageTest extends MockedTest diff --git a/tests/src/Core/Logger/SyslogLoggerWrapper.php b/tests/src/Core/Logger/SyslogLoggerWrapper.php index 1e0c4535f9..dce28b164c 100644 --- a/tests/src/Core/Logger/SyslogLoggerWrapper.php +++ b/tests/src/Core/Logger/SyslogLoggerWrapper.php @@ -21,7 +21,7 @@ namespace Friendica\Test\src\Core\Logger; -use Friendica\Core\Logger\Capabilities\IHaveCallIntrospections; +use Friendica\Core\Logger\Capability\IHaveCallIntrospections; use Friendica\Core\Logger\Type\SyslogLogger; /** -- 2.39.5