mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-07 15:54:26 +02:00
Remove unused StaticEventSubscriber interface
This commit is contained in:
parent
2e660f44f2
commit
2a02f58886
3 changed files with 1 additions and 44 deletions
|
@ -19,7 +19,7 @@ use Friendica\Event\NamedEvent;
|
|||
*
|
||||
* @internal Provides BC
|
||||
*/
|
||||
final class HookEventBridge implements StaticEventSubscriber
|
||||
final class HookEventBridge
|
||||
{
|
||||
/**
|
||||
* This allows us to mock the Hook call in tests.
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
<?php
|
||||
|
||||
// Copyright (C) 2010-2024, the Friendica project
|
||||
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Friendica\EventSubscriber;
|
||||
|
||||
/**
|
||||
* Define events that should be reacted to.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
interface StaticEventSubscriber
|
||||
{
|
||||
/**
|
||||
* Return an array of events to subscribe to.
|
||||
* The key must the event class name.
|
||||
* The value must the method of the implementing class to call.
|
||||
* The method will be called statically with the event class as first parameter.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```php
|
||||
* return [Event::class => 'onEvent'];
|
||||
* ```
|
||||
*
|
||||
* @return array<class-string, string>
|
||||
*/
|
||||
public static function getStaticSubscribedEvents(): array;
|
||||
}
|
|
@ -12,19 +12,10 @@ namespace Friendica\Test\Unit\EventSubscriber;
|
|||
use Friendica\Event\Event;
|
||||
use Friendica\Event\HtmlFilterEvent;
|
||||
use Friendica\EventSubscriber\HookEventBridge;
|
||||
use Friendica\EventSubscriber\StaticEventSubscriber;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class HookEventBridgeTest extends TestCase
|
||||
{
|
||||
public function testCorrectImplementation(): void
|
||||
{
|
||||
$this->assertTrue(
|
||||
is_subclass_of(HookEventBridge::class, StaticEventSubscriber::class, true),
|
||||
HookEventBridge::class . ' does not implement ' . StaticEventSubscriber::class
|
||||
);
|
||||
}
|
||||
|
||||
public function testGetStaticSubscribedEventsReturnsStaticMethods(): void
|
||||
{
|
||||
$expected = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue