mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-11 09:14:27 +02:00
Set getter methods as static
This commit is contained in:
parent
0b1325f297
commit
1924cc61a0
4 changed files with 15 additions and 15 deletions
|
@ -25,13 +25,13 @@ final class Addon
|
|||
|
||||
public function getRequiredDependencies(): array
|
||||
{
|
||||
return $this->bootstrap->getRequiredDependencies();
|
||||
return $this->bootstrap::getRequiredDependencies();
|
||||
}
|
||||
|
||||
public function getProvidedDependencyRules(): array
|
||||
{
|
||||
if ($this->bootstrap instanceof DependencyProvider) {
|
||||
return $this->bootstrap->provideDependencyRules();
|
||||
return $this->bootstrap::provideDependencyRules();
|
||||
}
|
||||
|
||||
return [];
|
||||
|
|
|
@ -25,12 +25,7 @@ interface AddonBootstrap
|
|||
* return [LoggerInterface::class];
|
||||
* ```
|
||||
*/
|
||||
public function getRequiredDependencies(): array;
|
||||
|
||||
/**
|
||||
* Init the addon with the required dependencies.
|
||||
*/
|
||||
public function initAddon(AddonStartEvent $event): void;
|
||||
public static function getRequiredDependencies(): array;
|
||||
|
||||
/**
|
||||
* Return an array of events to subscribe to.
|
||||
|
@ -46,5 +41,10 @@ interface AddonBootstrap
|
|||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function getSubscribedEvents(): array;
|
||||
public static function getSubscribedEvents(): array;
|
||||
|
||||
/**
|
||||
* Init the addon with the required dependencies.
|
||||
*/
|
||||
public function initAddon(AddonStartEvent $event): void;
|
||||
}
|
||||
|
|
|
@ -17,10 +17,10 @@ interface DependencyProvider
|
|||
/**
|
||||
* Returns an array of Dice rules.
|
||||
*/
|
||||
public function provideDependencyRules(): array;
|
||||
public static function provideDependencyRules(): array;
|
||||
|
||||
/**
|
||||
* Returns an array of strategy rules.
|
||||
*/
|
||||
public function provideStrategyRules(): array;
|
||||
public static function provideStrategyRules(): array;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ class HelloAddon implements AddonBootstrap, DependencyProvider
|
|||
*
|
||||
* The dependencies will be passed to the initAddon() method via AddonStartEvent::getDependencies().
|
||||
*/
|
||||
public function getRequiredDependencies(): array
|
||||
public static function getRequiredDependencies(): array
|
||||
{
|
||||
return [
|
||||
LoggerInterface::class,
|
||||
|
@ -56,7 +56,7 @@ class HelloAddon implements AddonBootstrap, DependencyProvider
|
|||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function getSubscribedEvents(): array
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
HtmlFilterEvent::PAGE_END => 'onPageEnd',
|
||||
|
@ -66,7 +66,7 @@ class HelloAddon implements AddonBootstrap, DependencyProvider
|
|||
/**
|
||||
* Returns an array of Dice rules.
|
||||
*/
|
||||
public function provideDependencyRules(): array
|
||||
public static function provideDependencyRules(): array
|
||||
{
|
||||
// or return require($path_to_dependencies_file);
|
||||
return [
|
||||
|
@ -80,7 +80,7 @@ class HelloAddon implements AddonBootstrap, DependencyProvider
|
|||
/**
|
||||
* Returns an array of strategy rules.
|
||||
*/
|
||||
public function provideStrategyRules(): array
|
||||
public static function provideStrategyRules(): array
|
||||
{
|
||||
// or return require($path_to_strategies_file);
|
||||
return [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue