Skip to content

Commit 830d911

Browse files
authored
Merge pull request #23383 from nextcloud/backport/23371/stable20
[stable20] Add Psalm type for the bootstrap registration context
2 parents aff0156 + bab06f9 commit 830d911

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

lib/public/AppFramework/Bootstrap/IRegistrationContext.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,18 @@ public function registerCapability(string $capability): void;
5353
* will receive unhandled exceptions and throwables
5454
*
5555
* @param string $reporterClass
56+
* @psalm-param class-string<\OCP\Support\CrashReport\IReporter> $reporterClass
5657
* @return void
5758
* @since 20.0.0
5859
*/
5960
public function registerCrashReporter(string $reporterClass): void;
6061

6162
/**
62-
* Register an implementation of \OCP\Dashboard\IPanel that
63-
* will handle the implementation of a dashboard panel
63+
* Register an implementation of \OCP\Dashboard\IWidget that
64+
* will handle the implementation of a dashboard widget
6465
*
6566
* @param string $widgetClass
67+
* @psalm-param class-string<\OCP\Dashboard\IWidget> $widgetClass
6668
* @return void
6769
* @since 20.0.0
6870
*/
@@ -72,6 +74,7 @@ public function registerDashboardWidget(string $widgetClass): void;
7274
*
7375
* @param string $name
7476
* @param callable $factory
77+
* @psalm-param callable(\Psr\Container\ContainerInterface): mixed $factory
7578
* @param bool $shared
7679
*
7780
* @return void
@@ -83,7 +86,9 @@ public function registerService(string $name, callable $factory, bool $shared =
8386

8487
/**
8588
* @param string $alias
89+
* @psalm-param string|class-string $alias
8690
* @param string $target
91+
* @psalm-param string|class-string $target
8792
*
8893
* @return void
8994
* @see IContainer::registerAlias()
@@ -109,7 +114,9 @@ public function registerParameter(string $name, $value): void;
109114
* This is equivalent to calling IEventDispatcher::addServiceListener
110115
*
111116
* @param string $event preferably the fully-qualified class name of the Event sub class to listen for
117+
* @psalm-param string|class-string<\OCP\EventDispatcher\Event> $event preferably the fully-qualified class name of the Event sub class to listen for
112118
* @param string $listener fully qualified class name (or ::class notation) of a \OCP\EventDispatcher\IEventListener that can be built by the DI container
119+
* @psalm-param class-string<\OCP\EventDispatcher\IEventListener> $listener fully qualified class name that can be built by the DI container
113120
* @param int $priority
114121
*
115122
* @see IEventDispatcher::addServiceListener()
@@ -120,6 +127,7 @@ public function registerEventListener(string $event, string $listener, int $prio
120127

121128
/**
122129
* @param string $class
130+
* @psalm-param class-string<\OCP\AppFramework\Middleware> $class
123131
*
124132
* @return void
125133
* @see IAppContainer::registerMiddleWare()
@@ -136,6 +144,7 @@ public function registerMiddleware(string $class): void;
136144
* with you" in the Files app.
137145
*
138146
* @param string $class
147+
* @psalm-param class-string<\OCP\Search\IProvider> $class
139148
*
140149
* @return void
141150
*
@@ -149,6 +158,7 @@ public function registerSearchProvider(string $class): void;
149158
* It is allowed to register more than one option per app.
150159
*
151160
* @param string $class
161+
* @psalm-param class-string<\OCP\Authentication\IAlternativeLogin> $class
152162
*
153163
* @return void
154164
*

0 commit comments

Comments
 (0)