From 21811fc76557a5ca579b2c9da50b77df03392a23 Mon Sep 17 00:00:00 2001 From: Adam Daley Date: Wed, 5 Mar 2025 21:29:12 +0000 Subject: [PATCH] Remove / disable unused functions causing CI failures (#2627) Remove / disable unused functions causing failures --- src/library/Box/Event.php | 3 +- src/library/Box/EventDispatcher.php | 45 ----------------------------- 2 files changed, 2 insertions(+), 46 deletions(-) diff --git a/src/library/Box/Event.php b/src/library/Box/Event.php index d8dd86826..77218da95 100644 --- a/src/library/Box/Event.php +++ b/src/library/Box/Event.php @@ -156,11 +156,12 @@ class Box_Event implements ArrayAccess, FOSSBilling\InjectionAwareInterface /** * Removes a parameter (implements the ArrayAccess interface). + * This doesn't do anything! * * @param string $name The parameter name */ public function offsetUnset(mixed $name): void { - unset($this->parameters[$name]); + return; } } diff --git a/src/library/Box/EventDispatcher.php b/src/library/Box/EventDispatcher.php index 3f9572b60..831cc1c96 100644 --- a/src/library/Box/EventDispatcher.php +++ b/src/library/Box/EventDispatcher.php @@ -27,51 +27,6 @@ class Box_EventDispatcher $this->listeners[$name][] = $listener; } - /** - * TODO: Unsused? - * Disconnects a listener for a given event name. - * - * @param string $name An event name - * @param mixed $listener A PHP callable - * - * @return false|null false if listener does not exist, null otherwise - */ - public function disconnect($name, mixed $listener) - { - if (!isset($this->listeners[$name])) { - return false; - } - - foreach ($this->listeners[$name] as $i => $callable) { - if ($listener === $callable) { - unset($this->listeners[$name][$i]); - } - } - - return null; - } - - /** - * TODO: Unsused? - * Disconnects all listeners for a given event name. - * - * @param string $name An event name - * - * @return false|null false if listener does not exist, null otherwise - */ - public function disconnectAll($name) - { - if (!isset($this->listeners[$name])) { - return false; - } - - foreach ($this->listeners[$name] as $i => $callable) { - unset($this->listeners[$name][$i]); - } - - return null; - } - /** * Notifies all listeners of a given event. *