mirror of
https://github.com/friendica/friendica
synced 2025-04-27 15:50:12 +00:00
Add tests for InstanceManager and remove Decorator hook logic (avoid complex Dice logic)
This commit is contained in:
parent
527622df4a
commit
93af6f0564
14 changed files with 218 additions and 390 deletions
|
@ -22,7 +22,7 @@
|
|||
namespace Friendica\Core\Hooks\Util;
|
||||
|
||||
use Friendica\Core\Addon\Capabilities\ICanLoadAddons;
|
||||
use Friendica\Core\Hooks\Capabilities\HookType;
|
||||
use Friendica\Core\Hooks\Capabilities\BehavioralHookType;
|
||||
use Friendica\Core\Hooks\Capabilities\ICanRegisterInstances;
|
||||
use Friendica\Core\Hooks\Exceptions\HookConfigException;
|
||||
|
||||
|
@ -63,7 +63,7 @@ class HookFileManager
|
|||
|
||||
foreach ($this->hookConfig as $hookType => $classList) {
|
||||
switch ($hookType) {
|
||||
case HookType::STRATEGY:
|
||||
case BehavioralHookType::STRATEGY:
|
||||
foreach ($classList as $interface => $strategy) {
|
||||
foreach ($strategy as $dependencyName => $names) {
|
||||
if (is_array($names)) {
|
||||
|
@ -76,17 +76,6 @@ class HookFileManager
|
|||
}
|
||||
}
|
||||
break;
|
||||
case HookType::DECORATOR:
|
||||
foreach ($classList as $interface => $decorators) {
|
||||
if (is_array($decorators)) {
|
||||
foreach ($decorators as $decorator) {
|
||||
$instanceRegister->registerDecorator($interface, $decorator);
|
||||
}
|
||||
} else {
|
||||
$instanceRegister->registerDecorator($interface, $decorators);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue