Let event classes extending Event

This commit is contained in:
Art4 2025-01-28 09:11:33 +00:00 committed by Hypolite Petovan
parent 4cbee618d6
commit 5b28b3d28f
3 changed files with 7 additions and 19 deletions

View file

@ -16,23 +16,17 @@ use Friendica\Core\Config\Util\ConfigFileManager;
* *
* @internal * @internal
*/ */
final class ConfigLoadedEvent implements NamedEvent final class ConfigLoadedEvent extends Event
{ {
public const CONFIG_LOADED = 'friendica.config_loaded'; public const CONFIG_LOADED = 'friendica.config_loaded';
private string $name;
private ConfigFileManager $config; private ConfigFileManager $config;
public function __construct(string $name, ConfigFileManager $config) public function __construct(string $name, ConfigFileManager $config)
{ {
$this->name = $name; parent::__construct($name);
$this->config = $config;
}
public function getName(): string $this->config = $config;
{
return $this->name;
} }
public function getConfig(): ConfigFileManager public function getConfig(): ConfigFileManager

View file

@ -14,7 +14,7 @@ namespace Friendica\Event;
* *
* @internal * @internal
*/ */
final class Event implements NamedEvent class Event implements NamedEvent
{ {
/** /**
* Friendica is initialized. * Friendica is initialized.

View file

@ -14,7 +14,7 @@ namespace Friendica\Event;
* *
* @internal * @internal
*/ */
final class HtmlFilterEvent implements NamedEvent final class HtmlFilterEvent extends Event
{ {
public const HEAD = 'friendica.html.head'; public const HEAD = 'friendica.html.head';
@ -24,19 +24,13 @@ final class HtmlFilterEvent implements NamedEvent
public const PAGE_END = 'friendica.html.page_end'; public const PAGE_END = 'friendica.html.page_end';
private string $name;
private string $html; private string $html;
public function __construct(string $name, string $html) public function __construct(string $name, string $html)
{ {
$this->name = $name; parent::__construct($name);
$this->html = $html;
}
public function getName(): string $this->html = $html;
{
return $this->name;
} }
public function getHtml(): string public function getHtml(): string