]> git.mxchange.org Git - friendica.git/commitdiff
Remove unused StaticEventSubscriber interface
authorArt4 <art4@wlabs.de>
Mon, 27 Jan 2025 15:11:01 +0000 (15:11 +0000)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 4 Feb 2025 18:22:53 +0000 (13:22 -0500)
src/EventSubscriber/HookEventBridge.php
src/EventSubscriber/StaticEventSubscriber.php [deleted file]
tests/Unit/EventSubscriber/HookEventBridgeTest.php

index bce4063ef2431f0dfb82bc524def3fd58eb9333a..f4da4f9dd51466a82d9bbfc70eb29e6e43f9126e 100644 (file)
@@ -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.
diff --git a/src/EventSubscriber/StaticEventSubscriber.php b/src/EventSubscriber/StaticEventSubscriber.php
deleted file mode 100644 (file)
index 4606b4a..0000000
+++ /dev/null
@@ -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;
-}
index a9cc237bb7ef93319cef19e467e304c71ada0fd6..ec04ded87ec91745e9377b950cf3b41e1a134917 100644 (file)
@@ -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 = [