feat: allow unregistering group backends

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2026-05-23 17:51:14 +02:00
parent 10e636f61c
commit a5ba481653
2 changed files with 13 additions and 0 deletions

View file

@ -104,6 +104,14 @@ class Manager extends PublicEmitter implements IGroupManager {
$this->clearCaches();
}
#[\Override]
public function removeBackend(GroupInterface $backend): void {
$this->clearCaches();
if (($i = array_search($backend, $this->backends)) !== false) {
unset($this->backends[$i]);
}
}
#[\Override]
public function clearBackends() {
$this->backends = [];

View file

@ -39,6 +39,11 @@ interface IGroupManager {
*/
public function addBackend($backend);
/**
* @since 34.0.0
*/
public function removeBackend(GroupInterface $backend): void;
/**
* @since 8.0.0
*/