Passed
Push — master ( 919a84...b58d4f )
by Christoph
16:54 queued 17s
created

php$0 ➔ getMiddlewareRegistrations()   A

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @copyright 2020 Christoph Wurst <[email protected]>
7
 *
8
 * @author Christoph Wurst <[email protected]>
9
 * @author Joas Schilling <[email protected]>
10
 * @author Julius Härtl <[email protected]>
11
 * @author Roeland Jago Douma <[email protected]>
12
 *
13
 * @license GNU AGPL version 3 or any later version
14
 *
15
 * This program is free software: you can redistribute it and/or modify
16
 * it under the terms of the GNU Affero General Public License as
17
 * published by the Free Software Foundation, either version 3 of the
18
 * License, or (at your option) any later version.
19
 *
20
 * This program is distributed in the hope that it will be useful,
21
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
 * GNU Affero General Public License for more details.
24
 *
25
 * You should have received a copy of the GNU Affero General Public License
26
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
27
 *
28
 */
29
30
namespace OC\AppFramework\Bootstrap;
31
32
use Closure;
33
use OCP\Calendar\Resource\IBackend as IResourceBackend;
34
use OCP\Calendar\Room\IBackend as IRoomBackend;
35
use OCP\Collaboration\Reference\IReferenceProvider;
36
use OCP\Talk\ITalkBackend;
37
use RuntimeException;
38
use function array_shift;
39
use OC\Support\CrashReport\Registry;
40
use OCP\AppFramework\App;
41
use OCP\AppFramework\Bootstrap\IRegistrationContext;
42
use OCP\AppFramework\Middleware;
43
use OCP\AppFramework\Services\InitialStateProvider;
44
use OCP\Authentication\IAlternativeLogin;
45
use OCP\Calendar\ICalendarProvider;
46
use OCP\Capabilities\ICapability;
47
use OCP\Dashboard\IManager;
48
use OCP\Dashboard\IWidget;
49
use OCP\EventDispatcher\IEventDispatcher;
50
use OCP\Files\Template\ICustomTemplateProvider;
51
use OCP\Http\WellKnown\IHandler;
52
use OCP\Notification\INotifier;
53
use OCP\Profile\ILinkAction;
54
use OCP\Search\IProvider;
55
use OCP\Support\CrashReport\IReporter;
56
use OCP\UserMigration\IMigrator as IUserMigrator;
57
use Psr\Log\LoggerInterface;
58
use Throwable;
59
60
class RegistrationContext {
61
	/** @var ServiceRegistration<ICapability>[] */
62
	private $capabilities = [];
63
64
	/** @var ServiceRegistration<IReporter>[] */
65
	private $crashReporters = [];
66
67
	/** @var ServiceRegistration<IWidget>[] */
68
	private $dashboardPanels = [];
69
70
	/** @var ServiceRegistration<ILinkAction>[] */
71
	private $profileLinkActions = [];
72
73
	/** @var null|ServiceRegistration<ITalkBackend> */
74
	private $talkBackendRegistration = null;
75
76
	/** @var ServiceRegistration<IResourceBackend>[] */
77
	private $calendarResourceBackendRegistrations = [];
78
79
	/** @var ServiceRegistration<IRoomBackend>[] */
80
	private $calendarRoomBackendRegistrations = [];
81
82
	/** @var ServiceRegistration<IUserMigrator>[] */
83
	private $userMigrators = [];
84
85
	/** @var ServiceFactoryRegistration[] */
86
	private $services = [];
87
88
	/** @var ServiceAliasRegistration[] */
89
	private $aliases = [];
90
91
	/** @var ParameterRegistration[] */
92
	private $parameters = [];
93
94
	/** @var EventListenerRegistration[] */
95
	private $eventListeners = [];
96
97
	/** @var ServiceRegistration<Middleware>[] */
98
	private $middlewares = [];
99
100
	/** @var ServiceRegistration<IProvider>[] */
101
	private $searchProviders = [];
102
103
	/** @var ServiceRegistration<IAlternativeLogin>[] */
104
	private $alternativeLogins = [];
105
106
	/** @var ServiceRegistration<InitialStateProvider>[] */
107
	private $initialStates = [];
108
109
	/** @var ServiceRegistration<IHandler>[] */
110
	private $wellKnownHandlers = [];
111
112
	/** @var ServiceRegistration<ICustomTemplateProvider>[] */
113
	private $templateProviders = [];
114
115
	/** @var ServiceRegistration<INotifier>[] */
116
	private $notifierServices = [];
117
118
	/** @var ServiceRegistration<\OCP\Authentication\TwoFactorAuth\IProvider>[] */
119
	private $twoFactorProviders = [];
120
121
	/** @var ServiceRegistration<ICalendarProvider>[] */
122
	private $calendarProviders = [];
123
124
	/** @var ServiceRegistration<IReferenceProvider>[] */
125
	private array $referenceProviders = [];
126
127
	/** @var ParameterRegistration[] */
128
	private $sensitiveMethods = [];
129
130
	/** @var LoggerInterface */
131
	private $logger;
132
133
	/** @var PreviewProviderRegistration[] */
134
	private $previewProviders = [];
135
136
	public function __construct(LoggerInterface $logger) {
137
		$this->logger = $logger;
138
	}
139
140
	public function for(string $appId): IRegistrationContext {
141
		return new class($appId, $this) implements IRegistrationContext {
142
			/** @var string */
143
			private $appId;
144
145
			/** @var RegistrationContext */
146
			private $context;
147
148
			public function __construct(string $appId, RegistrationContext $context) {
149
				$this->appId = $appId;
150
				$this->context = $context;
151
			}
152
153
			public function registerCapability(string $capability): void {
154
				$this->context->registerCapability(
155
					$this->appId,
156
					$capability
157
				);
158
			}
159
160
			public function registerCrashReporter(string $reporterClass): void {
161
				$this->context->registerCrashReporter(
162
					$this->appId,
163
					$reporterClass
164
				);
165
			}
166
167
			public function registerDashboardWidget(string $widgetClass): void {
168
				$this->context->registerDashboardPanel(
169
					$this->appId,
170
					$widgetClass
171
				);
172
			}
173
174
			public function registerService(string $name, callable $factory, bool $shared = true): void {
175
				$this->context->registerService(
176
					$this->appId,
177
					$name,
178
					$factory,
179
					$shared
180
				);
181
			}
182
183
			public function registerServiceAlias(string $alias, string $target): void {
184
				$this->context->registerServiceAlias(
185
					$this->appId,
186
					$alias,
187
					$target
188
				);
189
			}
190
191
			public function registerParameter(string $name, $value): void {
192
				$this->context->registerParameter(
193
					$this->appId,
194
					$name,
195
					$value
196
				);
197
			}
198
199
			public function registerEventListener(string $event, string $listener, int $priority = 0): void {
200
				$this->context->registerEventListener(
201
					$this->appId,
202
					$event,
203
					$listener,
204
					$priority
205
				);
206
			}
207
208
			public function registerMiddleware(string $class): void {
209
				$this->context->registerMiddleware(
210
					$this->appId,
211
					$class
212
				);
213
			}
214
215
			public function registerSearchProvider(string $class): void {
216
				$this->context->registerSearchProvider(
217
					$this->appId,
218
					$class
219
				);
220
			}
221
222
			public function registerAlternativeLogin(string $class): void {
223
				$this->context->registerAlternativeLogin(
224
					$this->appId,
225
					$class
226
				);
227
			}
228
229
			public function registerInitialStateProvider(string $class): void {
230
				$this->context->registerInitialState(
231
					$this->appId,
232
					$class
233
				);
234
			}
235
236
			public function registerWellKnownHandler(string $class): void {
237
				$this->context->registerWellKnown(
238
					$this->appId,
239
					$class
240
				);
241
			}
242
243
			public function registerTemplateProvider(string $providerClass): void {
244
				$this->context->registerTemplateProvider(
245
					$this->appId,
246
					$providerClass
247
				);
248
			}
249
250
			public function registerNotifierService(string $notifierClass): void {
251
				$this->context->registerNotifierService(
252
					$this->appId,
253
					$notifierClass
254
				);
255
			}
256
257
			public function registerTwoFactorProvider(string $twoFactorProviderClass): void {
258
				$this->context->registerTwoFactorProvider(
259
					$this->appId,
260
					$twoFactorProviderClass
261
				);
262
			}
263
264
			public function registerPreviewProvider(string $previewProviderClass, string $mimeTypeRegex): void {
265
				$this->context->registerPreviewProvider(
266
					$this->appId,
267
					$previewProviderClass,
268
					$mimeTypeRegex
269
				);
270
			}
271
272
			public function registerCalendarProvider(string $class): void {
273
				$this->context->registerCalendarProvider(
274
					$this->appId,
275
					$class
276
				);
277
			}
278
279
			public function registerReferenceProvider(string $class): void {
280
				$this->context->registerReferenceProvider(
281
					$this->appId,
282
					$class
283
				);
284
			}
285
286
			public function registerProfileLinkAction(string $actionClass): void {
287
				$this->context->registerProfileLinkAction(
288
					$this->appId,
289
					$actionClass
290
				);
291
			}
292
293
			public function registerTalkBackend(string $backend): void {
294
				$this->context->registerTalkBackend(
295
					$this->appId,
296
					$backend
297
				);
298
			}
299
300
			public function registerCalendarResourceBackend(string $class): void {
301
				$this->context->registerCalendarResourceBackend(
302
					$this->appId,
303
					$class
304
				);
305
			}
306
307
			public function registerCalendarRoomBackend(string $class): void {
308
				$this->context->registerCalendarRoomBackend(
309
					$this->appId,
310
					$class
311
				);
312
			}
313
314
			public function registerUserMigrator(string $migratorClass): void {
315
				$this->context->registerUserMigrator(
316
					$this->appId,
317
					$migratorClass
318
				);
319
			}
320
321
			public function registerSensitiveMethods(string $class, array $methods): void {
322
				$this->context->registerSensitiveMethods(
323
					$this->appId,
324
					$class,
325
					$methods
326
				);
327
			}
328
		};
329
	}
330
331
	/**
332
	 * @psalm-param class-string<ICapability> $capability
333
	 */
334
	public function registerCapability(string $appId, string $capability): void {
335
		$this->capabilities[] = new ServiceRegistration($appId, $capability);
336
	}
337
338
	/**
339
	 * @psalm-param class-string<IReporter> $capability
340
	 */
341
	public function registerCrashReporter(string $appId, string $reporterClass): void {
342
		$this->crashReporters[] = new ServiceRegistration($appId, $reporterClass);
343
	}
344
345
	/**
346
	 * @psalm-param class-string<IWidget> $capability
347
	 */
348
	public function registerDashboardPanel(string $appId, string $panelClass): void {
349
		$this->dashboardPanels[] = new ServiceRegistration($appId, $panelClass);
350
	}
351
352
	public function registerService(string $appId, string $name, callable $factory, bool $shared = true): void {
353
		$this->services[] = new ServiceFactoryRegistration($appId, $name, $factory, $shared);
354
	}
355
356
	public function registerServiceAlias(string $appId, string $alias, string $target): void {
357
		$this->aliases[] = new ServiceAliasRegistration($appId, $alias, $target);
358
	}
359
360
	public function registerParameter(string $appId, string $name, $value): void {
361
		$this->parameters[] = new ParameterRegistration($appId, $name, $value);
362
	}
363
364
	public function registerEventListener(string $appId, string $event, string $listener, int $priority = 0): void {
365
		$this->eventListeners[] = new EventListenerRegistration($appId, $event, $listener, $priority);
366
	}
367
368
	/**
369
	 * @psalm-param class-string<Middleware> $class
370
	 */
371
	public function registerMiddleware(string $appId, string $class): void {
372
		$this->middlewares[] = new ServiceRegistration($appId, $class);
373
	}
374
375
	public function registerSearchProvider(string $appId, string $class) {
376
		$this->searchProviders[] = new ServiceRegistration($appId, $class);
377
	}
378
379
	public function registerAlternativeLogin(string $appId, string $class): void {
380
		$this->alternativeLogins[] = new ServiceRegistration($appId, $class);
381
	}
382
383
	public function registerInitialState(string $appId, string $class): void {
384
		$this->initialStates[] = new ServiceRegistration($appId, $class);
385
	}
386
387
	public function registerWellKnown(string $appId, string $class): void {
388
		$this->wellKnownHandlers[] = new ServiceRegistration($appId, $class);
389
	}
390
391
	public function registerTemplateProvider(string $appId, string $class): void {
392
		$this->templateProviders[] = new ServiceRegistration($appId, $class);
393
	}
394
395
	public function registerNotifierService(string $appId, string $class): void {
396
		$this->notifierServices[] = new ServiceRegistration($appId, $class);
397
	}
398
399
	public function registerTwoFactorProvider(string $appId, string $class): void {
400
		$this->twoFactorProviders[] = new ServiceRegistration($appId, $class);
401
	}
402
403
	public function registerPreviewProvider(string $appId, string $class, string $mimeTypeRegex): void {
404
		$this->previewProviders[] = new PreviewProviderRegistration($appId, $class, $mimeTypeRegex);
405
	}
406
407
	public function registerCalendarProvider(string $appId, string $class): void {
408
		$this->calendarProviders[] = new ServiceRegistration($appId, $class);
409
	}
410
411
	public function registerReferenceProvider(string $appId, string $class): void {
412
		$this->referenceProviders[] = new ServiceRegistration($appId, $class);
413
	}
414
415
	/**
416
	 * @psalm-param class-string<ILinkAction> $actionClass
417
	 */
418
	public function registerProfileLinkAction(string $appId, string $actionClass): void {
419
		$this->profileLinkActions[] = new ServiceRegistration($appId, $actionClass);
420
	}
421
422
	/**
423
	 * @psalm-param class-string<ITalkBackend> $backend
424
	 */
425
	public function registerTalkBackend(string $appId, string $backend) {
426
		// Some safeguards for invalid registrations
427
		if ($appId !== 'spreed') {
428
			throw new RuntimeException("Only the Talk app is allowed to register a Talk backend");
429
		}
430
		if ($this->talkBackendRegistration !== null) {
431
			throw new RuntimeException("There can only be one Talk backend");
432
		}
433
434
		$this->talkBackendRegistration = new ServiceRegistration($appId, $backend);
435
	}
436
437
	public function registerCalendarResourceBackend(string $appId, string $class) {
438
		$this->calendarResourceBackendRegistrations[] = new ServiceRegistration(
439
			$appId,
440
			$class,
441
		);
442
	}
443
444
	public function registerCalendarRoomBackend(string $appId, string $class) {
445
		$this->calendarRoomBackendRegistrations[] = new ServiceRegistration(
446
			$appId,
447
			$class,
448
		);
449
	}
450
451
	/**
452
	 * @psalm-param class-string<IUserMigrator> $migratorClass
453
	 */
454
	public function registerUserMigrator(string $appId, string $migratorClass): void {
455
		$this->userMigrators[] = new ServiceRegistration($appId, $migratorClass);
456
	}
457
458
	public function registerSensitiveMethods(string $appId, string $class, array $methods): void {
459
		$methods = array_filter($methods, 'is_string');
460
		$this->sensitiveMethods[] = new ParameterRegistration($appId, $class, $methods);
461
	}
462
463
	/**
464
	 * @param App[] $apps
465
	 */
466
	public function delegateCapabilityRegistrations(array $apps): void {
467
		while (($registration = array_shift($this->capabilities)) !== null) {
0 ignored issues
show
Bug introduced by
$this->capabilities of type OC\AppFramework\Bootstrap\ServiceRegistration is incompatible with the type array expected by parameter $array of array_shift(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

467
		while (($registration = array_shift(/** @scrutinizer ignore-type */ $this->capabilities)) !== null) {
Loading history...
468
			$appId = $registration->getAppId();
469
			if (!isset($apps[$appId])) {
470
				// If we land here something really isn't right. But at least we caught the
471
				// notice that is otherwise emitted for the undefined index
472
				$this->logger->error("App $appId not loaded for the capability registration");
473
474
				continue;
475
			}
476
477
			try {
478
				$apps[$appId]
479
					->getContainer()
480
					->registerCapability($registration->getService());
481
			} catch (Throwable $e) {
482
				$this->logger->error("Error during capability registration of $appId: " . $e->getMessage(), [
483
					'exception' => $e,
484
				]);
485
			}
486
		}
487
	}
488
489
	/**
490
	 * @param App[] $apps
491
	 */
492
	public function delegateCrashReporterRegistrations(array $apps, Registry $registry): void {
0 ignored issues
show
Unused Code introduced by
The parameter $apps is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

492
	public function delegateCrashReporterRegistrations(/** @scrutinizer ignore-unused */ array $apps, Registry $registry): void {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
493
		while (($registration = array_shift($this->crashReporters)) !== null) {
0 ignored issues
show
Bug introduced by
$this->crashReporters of type OC\AppFramework\Bootstrap\ServiceRegistration is incompatible with the type array expected by parameter $array of array_shift(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

493
		while (($registration = array_shift(/** @scrutinizer ignore-type */ $this->crashReporters)) !== null) {
Loading history...
494
			try {
495
				$registry->registerLazy($registration->getService());
496
			} catch (Throwable $e) {
497
				$appId = $registration->getAppId();
498
				$this->logger->error("Error during crash reporter registration of $appId: " . $e->getMessage(), [
499
					'exception' => $e,
500
				]);
501
			}
502
		}
503
	}
504
505
	/**
506
	 * @param App[] $apps
507
	 */
508
	public function delegateDashboardPanelRegistrations(IManager $dashboardManager): void {
509
		while (($panel = array_shift($this->dashboardPanels)) !== null) {
0 ignored issues
show
Bug introduced by
$this->dashboardPanels of type OC\AppFramework\Bootstrap\ServiceRegistration is incompatible with the type array expected by parameter $array of array_shift(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

509
		while (($panel = array_shift(/** @scrutinizer ignore-type */ $this->dashboardPanels)) !== null) {
Loading history...
510
			try {
511
				$dashboardManager->lazyRegisterWidget($panel->getService(), $panel->getAppId());
512
			} catch (Throwable $e) {
513
				$appId = $panel->getAppId();
514
				$this->logger->error("Error during dashboard registration of $appId: " . $e->getMessage(), [
515
					'exception' => $e,
516
				]);
517
			}
518
		}
519
	}
520
521
	public function delegateEventListenerRegistrations(IEventDispatcher $eventDispatcher): void {
522
		while (($registration = array_shift($this->eventListeners)) !== null) {
523
			try {
524
				$eventDispatcher->addServiceListener(
525
					$registration->getEvent(),
526
					$registration->getService(),
527
					$registration->getPriority()
528
				);
529
			} catch (Throwable $e) {
530
				$appId = $registration->getAppId();
531
				$this->logger->error("Error during event listener registration of $appId: " . $e->getMessage(), [
532
					'exception' => $e,
533
				]);
534
			}
535
		}
536
	}
537
538
	/**
539
	 * @param App[] $apps
540
	 */
541
	public function delegateContainerRegistrations(array $apps): void {
542
		while (($registration = array_shift($this->services)) !== null) {
543
			$appId = $registration->getAppId();
544
			if (!isset($apps[$appId])) {
545
				// If we land here something really isn't right. But at least we caught the
546
				// notice that is otherwise emitted for the undefined index
547
				$this->logger->error("App $appId not loaded for the container service registration");
548
549
				continue;
550
			}
551
552
			try {
553
				/**
554
				 * Register the service and convert the callable into a \Closure if necessary
555
				 */
556
				$apps[$appId]
557
					->getContainer()
558
					->registerService(
559
						$registration->getName(),
560
						Closure::fromCallable($registration->getFactory()),
561
						$registration->isShared()
562
					);
563
			} catch (Throwable $e) {
564
				$this->logger->error("Error during service registration of $appId: " . $e->getMessage(), [
565
					'exception' => $e,
566
				]);
567
			}
568
		}
569
570
		while (($registration = array_shift($this->aliases)) !== null) {
571
			$appId = $registration->getAppId();
572
			if (!isset($apps[$appId])) {
573
				// If we land here something really isn't right. But at least we caught the
574
				// notice that is otherwise emitted for the undefined index
575
				$this->logger->error("App $appId not loaded for the container alias registration");
576
577
				continue;
578
			}
579
580
			try {
581
				$apps[$appId]
582
					->getContainer()
583
					->registerAlias(
584
						$registration->getAlias(),
585
						$registration->getTarget()
586
					);
587
			} catch (Throwable $e) {
588
				$this->logger->error("Error during service alias registration of $appId: " . $e->getMessage(), [
589
					'exception' => $e,
590
				]);
591
			}
592
		}
593
594
		while (($registration = array_shift($this->parameters)) !== null) {
595
			$appId = $registration->getAppId();
596
			if (!isset($apps[$appId])) {
597
				// If we land here something really isn't right. But at least we caught the
598
				// notice that is otherwise emitted for the undefined index
599
				$this->logger->error("App $appId not loaded for the container parameter registration");
600
601
				continue;
602
			}
603
604
			try {
605
				$apps[$appId]
606
					->getContainer()
607
					->registerParameter(
608
						$registration->getName(),
609
						$registration->getValue()
610
					);
611
			} catch (Throwable $e) {
612
				$this->logger->error("Error during service parameter registration of $appId: " . $e->getMessage(), [
613
					'exception' => $e,
614
				]);
615
			}
616
		}
617
	}
618
619
	/**
620
	 * @return ServiceRegistration<Middleware>[]
621
	 */
622
	public function getMiddlewareRegistrations(): array {
623
		return $this->middlewares;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->middlewares returns the type OC\AppFramework\Bootstrap\ServiceRegistration which is incompatible with the type-hinted return array.
Loading history...
624
	}
625
626
	/**
627
	 * @return ServiceRegistration<IProvider>[]
628
	 */
629
	public function getSearchProviders(): array {
630
		return $this->searchProviders;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->searchProviders returns the type OC\AppFramework\Bootstrap\ServiceRegistration which is incompatible with the type-hinted return array.
Loading history...
631
	}
632
633
	/**
634
	 * @return ServiceRegistration<IAlternativeLogin>[]
635
	 */
636
	public function getAlternativeLogins(): array {
637
		return $this->alternativeLogins;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->alternativeLogins returns the type OC\AppFramework\Bootstrap\ServiceRegistration which is incompatible with the type-hinted return array.
Loading history...
638
	}
639
640
	/**
641
	 * @return ServiceRegistration<InitialStateProvider>[]
642
	 */
643
	public function getInitialStates(): array {
644
		return $this->initialStates;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->initialStates returns the type OC\AppFramework\Bootstrap\ServiceRegistration which is incompatible with the type-hinted return array.
Loading history...
645
	}
646
647
	/**
648
	 * @return ServiceRegistration<IHandler>[]
649
	 */
650
	public function getWellKnownHandlers(): array {
651
		return $this->wellKnownHandlers;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->wellKnownHandlers returns the type OC\AppFramework\Bootstrap\ServiceRegistration which is incompatible with the type-hinted return array.
Loading history...
652
	}
653
654
	/**
655
	 * @return ServiceRegistration<ICustomTemplateProvider>[]
656
	 */
657
	public function getTemplateProviders(): array {
658
		return $this->templateProviders;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->templateProviders returns the type OC\AppFramework\Bootstrap\ServiceRegistration which is incompatible with the type-hinted return array.
Loading history...
659
	}
660
661
	/**
662
	 * @return ServiceRegistration<INotifier>[]
663
	 */
664
	public function getNotifierServices(): array {
665
		return $this->notifierServices;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->notifierServices returns the type OC\AppFramework\Bootstrap\ServiceRegistration which is incompatible with the type-hinted return array.
Loading history...
666
	}
667
668
	/**
669
	 * @return ServiceRegistration<\OCP\Authentication\TwoFactorAuth\IProvider>[]
670
	 */
671
	public function getTwoFactorProviders(): array {
672
		return $this->twoFactorProviders;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->twoFactorProviders returns the type OC\AppFramework\Bootstrap\ServiceRegistration which is incompatible with the type-hinted return array.
Loading history...
673
	}
674
675
	/**
676
	 * @return PreviewProviderRegistration[]
677
	 */
678
	public function getPreviewProviders(): array {
679
		return $this->previewProviders;
680
	}
681
682
	/**
683
	 * @return ServiceRegistration<ICalendarProvider>[]
684
	 */
685
	public function getCalendarProviders(): array {
686
		return $this->calendarProviders;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->calendarProviders returns the type OC\AppFramework\Bootstrap\ServiceRegistration which is incompatible with the type-hinted return array.
Loading history...
687
	}
688
689
	/**
690
	 * @return ServiceRegistration<IReferenceProvider>[]
691
	 */
692
	public function getReferenceProviders(): array {
693
		return $this->referenceProviders;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->referenceProviders returns the type array which is incompatible with the documented return type OC\AppFramework\Bootstrap\ServiceRegistration.
Loading history...
694
	}
695
696
	/**
697
	 * @return ServiceRegistration<ILinkAction>[]
698
	 */
699
	public function getProfileLinkActions(): array {
700
		return $this->profileLinkActions;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->profileLinkActions returns the type OC\AppFramework\Bootstrap\ServiceRegistration which is incompatible with the type-hinted return array.
Loading history...
701
	}
702
703
	/**
704
	 * @return ServiceRegistration|null
705
	 * @psalm-return ServiceRegistration<ITalkBackend>|null
706
	 */
707
	public function getTalkBackendRegistration(): ?ServiceRegistration {
708
		return $this->talkBackendRegistration;
709
	}
710
711
	/**
712
	 * @return ServiceRegistration[]
713
	 * @psalm-return ServiceRegistration<IResourceBackend>[]
714
	 */
715
	public function getCalendarResourceBackendRegistrations(): array {
716
		return $this->calendarResourceBackendRegistrations;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->calendarRe...rceBackendRegistrations returns the type OC\AppFramework\Bootstrap\ServiceRegistration which is incompatible with the type-hinted return array.
Loading history...
717
	}
718
719
	/**
720
	 * @return ServiceRegistration[]
721
	 * @psalm-return ServiceRegistration<IRoomBackend>[]
722
	 */
723
	public function getCalendarRoomBackendRegistrations(): array {
724
		return $this->calendarRoomBackendRegistrations;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->calendarRoomBackendRegistrations returns the type OC\AppFramework\Bootstrap\ServiceRegistration which is incompatible with the type-hinted return array.
Loading history...
725
	}
726
727
	/**
728
	 * @return ServiceRegistration<IUserMigrator>[]
729
	 */
730
	public function getUserMigrators(): array {
731
		return $this->userMigrators;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->userMigrators returns the type OC\AppFramework\Bootstrap\ServiceRegistration which is incompatible with the type-hinted return array.
Loading history...
732
	}
733
734
	/**
735
	 * @return ParameterRegistration[]
736
	 */
737
	public function getSensitiveMethods(): array {
738
		return $this->sensitiveMethods;
739
	}
740
}
741