From 1bd9e01fc7ee9abd3252eca3e9998e21e8d9c04f Mon Sep 17 00:00:00 2001
From: ashfame <mail@ashfame.com>
Date: Fri, 27 Dec 2024 12:47:58 +0400
Subject: [PATCH] remove clear method from both Handlers and Observers registry

---
 src/plugin/class-handlers-registry.php  | 12 ------------
 src/plugin/class-observers-registry.php | 12 ------------
 2 files changed, 24 deletions(-)

diff --git a/src/plugin/class-handlers-registry.php b/src/plugin/class-handlers-registry.php
index 93742259..6c51c8bc 100644
--- a/src/plugin/class-handlers-registry.php
+++ b/src/plugin/class-handlers-registry.php
@@ -90,18 +90,6 @@ public static function handle( SubjectType $type, Subject $subject ): void {
 		}
 	}
 
-	/**
-	 * Remove all handlers for a type
-	 *
-	 * @param SubjectType $type The type to clear handlers for.
-	 * @return void
-	 */
-	public static function clear( SubjectType $type ): void {
-		if ( isset( self::$handlers[ $type->value ] ) ) {
-			unset( self::$handlers[ $type->value ] );
-		}
-	}
-
 	/**
 	 * Set user choice for what transformer to run for a subject type when multiples are registered
 	 *
diff --git a/src/plugin/class-observers-registry.php b/src/plugin/class-observers-registry.php
index 52617f05..f72642e1 100644
--- a/src/plugin/class-observers-registry.php
+++ b/src/plugin/class-observers-registry.php
@@ -59,16 +59,4 @@ public static function observe( SubjectType $type, Subject $subject ): void {
 			$registered_observer['observer']( $subject );
 		}
 	}
-
-	/**
-	 * Remove all observers for a type
-	 *
-	 * @param SubjectType $type The type to clear observers for.
-	 * @return void
-	 */
-	public static function clear( SubjectType $type ): void {
-		if ( isset( self::$observers[ $type->value ] ) ) {
-			unset( self::$observers[ $type->value ] );
-		}
-	}
 }