]> git.mxchange.org Git - friendica.git/blobdiff - doc/StrategyHooks.md
"For you" now respects the "notify new posts" setting
[friendica.git] / doc / StrategyHooks.md
index 39fc1bd8df4cea30a7d6dc0ca520c169d87d7b86..2960ceeaad65498a2a8b9c866cfa6f372cb28434 100644 (file)
@@ -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.
 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, ...
 
 
 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');
 
 $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');
 
 /** @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.
 
 
 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
 
 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  => [
 
 return [
        H::STRATEGY  => [