1111
1212use OC \AppFramework \Bootstrap \Coordinator ;
1313use OC \Calendar \ResourcesRoomsUpdater ;
14- use OCP \AppFramework \QueryException ;
1514use OCP \Calendar \Resource \IBackend ;
1615use OCP \Calendar \Resource \IManager ;
1716use Psr \Container \ContainerInterface ;
@@ -21,11 +20,11 @@ class Manager implements IManager {
2120
2221 /**
2322 * @var string[] holds all registered resource backends
24- * @psalm-var class-string<IBackend>[]
23+ * @psalm-var list< class-string<IBackend>>
2524 */
2625 private array $ backends = [];
2726
28- /** @var IBackend[] holds all backends that have been initialized already */
27+ /** @var array<class-string< IBackend>, IBackend> holds all backends that have been initialized already */
2928 private array $ initializedBackends = [];
3029
3130 public function __construct (
@@ -35,26 +34,6 @@ public function __construct(
3534 ) {
3635 }
3736
38- /**
39- * Registers a resource backend
40- *
41- * @since 14.0.0
42- */
43- #[\Override]
44- public function registerBackend (string $ backendClass ): void {
45- $ this ->backends [$ backendClass ] = $ backendClass ;
46- }
47-
48- /**
49- * Unregisters a resource backend
50- *
51- * @since 14.0.0
52- */
53- #[\Override]
54- public function unregisterBackend (string $ backendClass ): void {
55- unset($ this ->backends [$ backendClass ], $ this ->initializedBackends [$ backendClass ]);
56- }
57-
5837 private function fetchBootstrapBackends (): void {
5938 if ($ this ->bootstrapBackendsLoaded ) {
6039 return ;
@@ -71,12 +50,6 @@ private function fetchBootstrapBackends(): void {
7150 }
7251 }
7352
74- /**
75- * @return IBackend[]
76- * @throws QueryException
77- * @since 14.0.0
78- */
79- #[\Override]
8053 public function getBackends ():array {
8154 $ this ->fetchBootstrapBackends ();
8255
@@ -91,33 +64,6 @@ public function getBackends():array {
9164 return array_values ($ this ->initializedBackends );
9265 }
9366
94- /**
95- * @param string $backendId
96- * @throws QueryException
97- */
98- #[\Override]
99- public function getBackend ($ backendId ): ?IBackend {
100- $ backends = $ this ->getBackends ();
101- foreach ($ backends as $ backend ) {
102- if ($ backend ->getBackendIdentifier () === $ backendId ) {
103- return $ backend ;
104- }
105- }
106-
107- return null ;
108- }
109-
110- /**
111- * removes all registered backend instances
112- *
113- * @since 14.0.0
114- */
115- #[\Override]
116- public function clear (): void {
117- $ this ->backends = [];
118- $ this ->initializedBackends = [];
119- }
120-
12167 #[\Override]
12268 public function update (): void {
12369 $ this ->updater ->updateResources ();
0 commit comments