@@ -41,159 +41,159 @@ |
||
| 41 | 41 | */ |
| 42 | 42 | interface IRegistrationContext { |
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * @param string $capability |
|
| 46 | - * @see IAppContainer::registerCapability |
|
| 47 | - * |
|
| 48 | - * @since 20.0.0 |
|
| 49 | - */ |
|
| 50 | - public function registerCapability(string $capability): void; |
|
| 51 | - |
|
| 52 | - /** |
|
| 53 | - * Register an implementation of \OCP\Support\CrashReport\IReporter that |
|
| 54 | - * will receive unhandled exceptions and throwables |
|
| 55 | - * |
|
| 56 | - * @param string $reporterClass |
|
| 57 | - * @psalm-param class-string<\OCP\Support\CrashReport\IReporter> $reporterClass |
|
| 58 | - * @return void |
|
| 59 | - * @since 20.0.0 |
|
| 60 | - */ |
|
| 61 | - public function registerCrashReporter(string $reporterClass): void; |
|
| 62 | - |
|
| 63 | - /** |
|
| 64 | - * Register an implementation of \OCP\Dashboard\IWidget that |
|
| 65 | - * will handle the implementation of a dashboard widget |
|
| 66 | - * |
|
| 67 | - * @param string $widgetClass |
|
| 68 | - * @psalm-param class-string<\OCP\Dashboard\IWidget> $widgetClass |
|
| 69 | - * @return void |
|
| 70 | - * @since 20.0.0 |
|
| 71 | - */ |
|
| 72 | - public function registerDashboardWidget(string $widgetClass): void; |
|
| 73 | - /** |
|
| 74 | - * Register a service |
|
| 75 | - * |
|
| 76 | - * @param string $name |
|
| 77 | - * @param callable $factory |
|
| 78 | - * @psalm-param callable(\Psr\Container\ContainerInterface): mixed $factory |
|
| 79 | - * @param bool $shared |
|
| 80 | - * |
|
| 81 | - * @return void |
|
| 82 | - * @see IContainer::registerService() |
|
| 83 | - * |
|
| 84 | - * @since 20.0.0 |
|
| 85 | - */ |
|
| 86 | - public function registerService(string $name, callable $factory, bool $shared = true): void; |
|
| 87 | - |
|
| 88 | - /** |
|
| 89 | - * @param string $alias |
|
| 90 | - * @psalm-param string|class-string $alias |
|
| 91 | - * @param string $target |
|
| 92 | - * @psalm-param string|class-string $target |
|
| 93 | - * |
|
| 94 | - * @return void |
|
| 95 | - * @see IContainer::registerAlias() |
|
| 96 | - * |
|
| 97 | - * @since 20.0.0 |
|
| 98 | - */ |
|
| 99 | - public function registerServiceAlias(string $alias, string $target): void; |
|
| 100 | - |
|
| 101 | - /** |
|
| 102 | - * @param string $name |
|
| 103 | - * @param mixed $value |
|
| 104 | - * |
|
| 105 | - * @return void |
|
| 106 | - * @see IContainer::registerParameter() |
|
| 107 | - * |
|
| 108 | - * @since 20.0.0 |
|
| 109 | - */ |
|
| 110 | - public function registerParameter(string $name, $value): void; |
|
| 111 | - |
|
| 112 | - /** |
|
| 113 | - * Register a service listener |
|
| 114 | - * |
|
| 115 | - * This is equivalent to calling IEventDispatcher::addServiceListener |
|
| 116 | - * |
|
| 117 | - * @template T of \OCP\EventDispatcher\Event |
|
| 118 | - * @param string $event preferably the fully-qualified class name of the Event sub class to listen for |
|
| 119 | - * @psalm-param string|class-string<T> $event preferably the fully-qualified class name of the Event sub class to listen for |
|
| 120 | - * @param string $listener fully qualified class name (or ::class notation) of a \OCP\EventDispatcher\IEventListener that can be built by the DI container |
|
| 121 | - * @psalm-param class-string<\OCP\EventDispatcher\IEventListener<T>> $listener fully qualified class name that can be built by the DI container |
|
| 122 | - * @param int $priority The higher this value, the earlier an event |
|
| 123 | - * listener will be triggered in the chain (defaults to 0) |
|
| 124 | - * |
|
| 125 | - * @see IEventDispatcher::addServiceListener() |
|
| 126 | - * |
|
| 127 | - * @since 20.0.0 |
|
| 128 | - */ |
|
| 129 | - public function registerEventListener(string $event, string $listener, int $priority = 0): void; |
|
| 130 | - |
|
| 131 | - /** |
|
| 132 | - * @param string $class |
|
| 133 | - * @psalm-param class-string<\OCP\AppFramework\Middleware> $class |
|
| 134 | - * |
|
| 135 | - * @return void |
|
| 136 | - * @see IAppContainer::registerMiddleWare() |
|
| 137 | - * |
|
| 138 | - * @since 20.0.0 |
|
| 139 | - */ |
|
| 140 | - public function registerMiddleware(string $class): void; |
|
| 141 | - |
|
| 142 | - /** |
|
| 143 | - * Register a search provider for the unified search |
|
| 144 | - * |
|
| 145 | - * It is allowed to register more than one provider per app as the search |
|
| 146 | - * results can go into distinct sections, e.g. "Files" and "Files shared |
|
| 147 | - * with you" in the Files app. |
|
| 148 | - * |
|
| 149 | - * @param string $class |
|
| 150 | - * @psalm-param class-string<\OCP\Search\IProvider> $class |
|
| 151 | - * |
|
| 152 | - * @return void |
|
| 153 | - * |
|
| 154 | - * @since 20.0.0 |
|
| 155 | - */ |
|
| 156 | - public function registerSearchProvider(string $class): void; |
|
| 157 | - |
|
| 158 | - /** |
|
| 159 | - * Register an alternative login option |
|
| 160 | - * |
|
| 161 | - * It is allowed to register more than one option per app. |
|
| 162 | - * |
|
| 163 | - * @param string $class |
|
| 164 | - * @psalm-param class-string<\OCP\Authentication\IAlternativeLogin> $class |
|
| 165 | - * |
|
| 166 | - * @return void |
|
| 167 | - * |
|
| 168 | - * @since 20.0.0 |
|
| 169 | - */ |
|
| 170 | - public function registerAlternativeLogin(string $class): void; |
|
| 171 | - |
|
| 172 | - /** |
|
| 173 | - * Register an initialstate provider |
|
| 174 | - * |
|
| 175 | - * It is allowed to register more than one provider per app. |
|
| 176 | - * |
|
| 177 | - * @param string $class |
|
| 178 | - * @psalm-param class-string<\OCP\AppFramework\Services\InitialStateProvider> $class |
|
| 179 | - * |
|
| 180 | - * @return void |
|
| 181 | - * |
|
| 182 | - * @since 21.0.0 |
|
| 183 | - */ |
|
| 184 | - public function registerInitialStateProvider(string $class): void; |
|
| 185 | - |
|
| 186 | - /** |
|
| 187 | - * Register a well known protocol handler |
|
| 188 | - * |
|
| 189 | - * It is allowed to register more than one handler per app. |
|
| 190 | - * |
|
| 191 | - * @param string $class |
|
| 192 | - * @psalm-param class-string<\OCP\Http\WellKnown\IHandler> $class |
|
| 193 | - * |
|
| 194 | - * @return void |
|
| 195 | - * |
|
| 196 | - * @since 21.0.0 |
|
| 197 | - */ |
|
| 198 | - public function registerWellKnownHandler(string $class): void; |
|
| 44 | + /** |
|
| 45 | + * @param string $capability |
|
| 46 | + * @see IAppContainer::registerCapability |
|
| 47 | + * |
|
| 48 | + * @since 20.0.0 |
|
| 49 | + */ |
|
| 50 | + public function registerCapability(string $capability): void; |
|
| 51 | + |
|
| 52 | + /** |
|
| 53 | + * Register an implementation of \OCP\Support\CrashReport\IReporter that |
|
| 54 | + * will receive unhandled exceptions and throwables |
|
| 55 | + * |
|
| 56 | + * @param string $reporterClass |
|
| 57 | + * @psalm-param class-string<\OCP\Support\CrashReport\IReporter> $reporterClass |
|
| 58 | + * @return void |
|
| 59 | + * @since 20.0.0 |
|
| 60 | + */ |
|
| 61 | + public function registerCrashReporter(string $reporterClass): void; |
|
| 62 | + |
|
| 63 | + /** |
|
| 64 | + * Register an implementation of \OCP\Dashboard\IWidget that |
|
| 65 | + * will handle the implementation of a dashboard widget |
|
| 66 | + * |
|
| 67 | + * @param string $widgetClass |
|
| 68 | + * @psalm-param class-string<\OCP\Dashboard\IWidget> $widgetClass |
|
| 69 | + * @return void |
|
| 70 | + * @since 20.0.0 |
|
| 71 | + */ |
|
| 72 | + public function registerDashboardWidget(string $widgetClass): void; |
|
| 73 | + /** |
|
| 74 | + * Register a service |
|
| 75 | + * |
|
| 76 | + * @param string $name |
|
| 77 | + * @param callable $factory |
|
| 78 | + * @psalm-param callable(\Psr\Container\ContainerInterface): mixed $factory |
|
| 79 | + * @param bool $shared |
|
| 80 | + * |
|
| 81 | + * @return void |
|
| 82 | + * @see IContainer::registerService() |
|
| 83 | + * |
|
| 84 | + * @since 20.0.0 |
|
| 85 | + */ |
|
| 86 | + public function registerService(string $name, callable $factory, bool $shared = true): void; |
|
| 87 | + |
|
| 88 | + /** |
|
| 89 | + * @param string $alias |
|
| 90 | + * @psalm-param string|class-string $alias |
|
| 91 | + * @param string $target |
|
| 92 | + * @psalm-param string|class-string $target |
|
| 93 | + * |
|
| 94 | + * @return void |
|
| 95 | + * @see IContainer::registerAlias() |
|
| 96 | + * |
|
| 97 | + * @since 20.0.0 |
|
| 98 | + */ |
|
| 99 | + public function registerServiceAlias(string $alias, string $target): void; |
|
| 100 | + |
|
| 101 | + /** |
|
| 102 | + * @param string $name |
|
| 103 | + * @param mixed $value |
|
| 104 | + * |
|
| 105 | + * @return void |
|
| 106 | + * @see IContainer::registerParameter() |
|
| 107 | + * |
|
| 108 | + * @since 20.0.0 |
|
| 109 | + */ |
|
| 110 | + public function registerParameter(string $name, $value): void; |
|
| 111 | + |
|
| 112 | + /** |
|
| 113 | + * Register a service listener |
|
| 114 | + * |
|
| 115 | + * This is equivalent to calling IEventDispatcher::addServiceListener |
|
| 116 | + * |
|
| 117 | + * @template T of \OCP\EventDispatcher\Event |
|
| 118 | + * @param string $event preferably the fully-qualified class name of the Event sub class to listen for |
|
| 119 | + * @psalm-param string|class-string<T> $event preferably the fully-qualified class name of the Event sub class to listen for |
|
| 120 | + * @param string $listener fully qualified class name (or ::class notation) of a \OCP\EventDispatcher\IEventListener that can be built by the DI container |
|
| 121 | + * @psalm-param class-string<\OCP\EventDispatcher\IEventListener<T>> $listener fully qualified class name that can be built by the DI container |
|
| 122 | + * @param int $priority The higher this value, the earlier an event |
|
| 123 | + * listener will be triggered in the chain (defaults to 0) |
|
| 124 | + * |
|
| 125 | + * @see IEventDispatcher::addServiceListener() |
|
| 126 | + * |
|
| 127 | + * @since 20.0.0 |
|
| 128 | + */ |
|
| 129 | + public function registerEventListener(string $event, string $listener, int $priority = 0): void; |
|
| 130 | + |
|
| 131 | + /** |
|
| 132 | + * @param string $class |
|
| 133 | + * @psalm-param class-string<\OCP\AppFramework\Middleware> $class |
|
| 134 | + * |
|
| 135 | + * @return void |
|
| 136 | + * @see IAppContainer::registerMiddleWare() |
|
| 137 | + * |
|
| 138 | + * @since 20.0.0 |
|
| 139 | + */ |
|
| 140 | + public function registerMiddleware(string $class): void; |
|
| 141 | + |
|
| 142 | + /** |
|
| 143 | + * Register a search provider for the unified search |
|
| 144 | + * |
|
| 145 | + * It is allowed to register more than one provider per app as the search |
|
| 146 | + * results can go into distinct sections, e.g. "Files" and "Files shared |
|
| 147 | + * with you" in the Files app. |
|
| 148 | + * |
|
| 149 | + * @param string $class |
|
| 150 | + * @psalm-param class-string<\OCP\Search\IProvider> $class |
|
| 151 | + * |
|
| 152 | + * @return void |
|
| 153 | + * |
|
| 154 | + * @since 20.0.0 |
|
| 155 | + */ |
|
| 156 | + public function registerSearchProvider(string $class): void; |
|
| 157 | + |
|
| 158 | + /** |
|
| 159 | + * Register an alternative login option |
|
| 160 | + * |
|
| 161 | + * It is allowed to register more than one option per app. |
|
| 162 | + * |
|
| 163 | + * @param string $class |
|
| 164 | + * @psalm-param class-string<\OCP\Authentication\IAlternativeLogin> $class |
|
| 165 | + * |
|
| 166 | + * @return void |
|
| 167 | + * |
|
| 168 | + * @since 20.0.0 |
|
| 169 | + */ |
|
| 170 | + public function registerAlternativeLogin(string $class): void; |
|
| 171 | + |
|
| 172 | + /** |
|
| 173 | + * Register an initialstate provider |
|
| 174 | + * |
|
| 175 | + * It is allowed to register more than one provider per app. |
|
| 176 | + * |
|
| 177 | + * @param string $class |
|
| 178 | + * @psalm-param class-string<\OCP\AppFramework\Services\InitialStateProvider> $class |
|
| 179 | + * |
|
| 180 | + * @return void |
|
| 181 | + * |
|
| 182 | + * @since 21.0.0 |
|
| 183 | + */ |
|
| 184 | + public function registerInitialStateProvider(string $class): void; |
|
| 185 | + |
|
| 186 | + /** |
|
| 187 | + * Register a well known protocol handler |
|
| 188 | + * |
|
| 189 | + * It is allowed to register more than one handler per app. |
|
| 190 | + * |
|
| 191 | + * @param string $class |
|
| 192 | + * @psalm-param class-string<\OCP\Http\WellKnown\IHandler> $class |
|
| 193 | + * |
|
| 194 | + * @return void |
|
| 195 | + * |
|
| 196 | + * @since 21.0.0 |
|
| 197 | + */ |
|
| 198 | + public function registerWellKnownHandler(string $class): void; |
|
| 199 | 199 | } |
@@ -34,64 +34,64 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | interface IEventDispatcher { |
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * @template T of \OCP\EventDispatcher\Event |
|
| 39 | - * @param string $eventName preferably the fully-qualified class name of the Event sub class |
|
| 40 | - * @psalm-param string|class-string<T> $eventName preferably the fully-qualified class name of the Event sub class |
|
| 41 | - * @param callable $listener the object that is invoked when a matching event is dispatched |
|
| 42 | - * @psalm-param callable(T):void $listener |
|
| 43 | - * @param int $priority The higher this value, the earlier an event |
|
| 44 | - * listener will be triggered in the chain (defaults to 0) |
|
| 45 | - * |
|
| 46 | - * @since 17.0.0 |
|
| 47 | - */ |
|
| 48 | - public function addListener(string $eventName, callable $listener, int $priority = 0): void; |
|
| 37 | + /** |
|
| 38 | + * @template T of \OCP\EventDispatcher\Event |
|
| 39 | + * @param string $eventName preferably the fully-qualified class name of the Event sub class |
|
| 40 | + * @psalm-param string|class-string<T> $eventName preferably the fully-qualified class name of the Event sub class |
|
| 41 | + * @param callable $listener the object that is invoked when a matching event is dispatched |
|
| 42 | + * @psalm-param callable(T):void $listener |
|
| 43 | + * @param int $priority The higher this value, the earlier an event |
|
| 44 | + * listener will be triggered in the chain (defaults to 0) |
|
| 45 | + * |
|
| 46 | + * @since 17.0.0 |
|
| 47 | + */ |
|
| 48 | + public function addListener(string $eventName, callable $listener, int $priority = 0): void; |
|
| 49 | 49 | |
| 50 | - /** |
|
| 51 | - * @template T of \OCP\EventDispatcher\Event |
|
| 52 | - * @param string $eventName preferably the fully-qualified class name of the Event sub class |
|
| 53 | - * @psalm-param string|class-string<T> $eventName preferably the fully-qualified class name of the Event sub class |
|
| 54 | - * @param callable $listener the object that is invoked when a matching event is dispatched |
|
| 55 | - * @psalm-param callable(T):void $listener |
|
| 56 | - * |
|
| 57 | - * @since 19.0.0 |
|
| 58 | - */ |
|
| 59 | - public function removeListener(string $eventName, callable $listener): void; |
|
| 50 | + /** |
|
| 51 | + * @template T of \OCP\EventDispatcher\Event |
|
| 52 | + * @param string $eventName preferably the fully-qualified class name of the Event sub class |
|
| 53 | + * @psalm-param string|class-string<T> $eventName preferably the fully-qualified class name of the Event sub class |
|
| 54 | + * @param callable $listener the object that is invoked when a matching event is dispatched |
|
| 55 | + * @psalm-param callable(T):void $listener |
|
| 56 | + * |
|
| 57 | + * @since 19.0.0 |
|
| 58 | + */ |
|
| 59 | + public function removeListener(string $eventName, callable $listener): void; |
|
| 60 | 60 | |
| 61 | - /** |
|
| 62 | - * @template T of \OCP\EventDispatcher\Event |
|
| 63 | - * @param string $eventName preferably the fully-qualified class name of the Event sub class to listen for |
|
| 64 | - * @psalm-param string|class-string<T> $eventName preferably the fully-qualified class name of the Event sub class to listen for |
|
| 65 | - * @param string $className fully qualified class name (or ::class notation) of a \OCP\EventDispatcher\IEventListener that can be built by the DI container |
|
| 66 | - * @psalm-param class-string<\OCP\EventDispatcher\IEventListener<T>> $className fully qualified class name that can be built by the DI container |
|
| 67 | - * @param int $priority The higher this value, the earlier an event |
|
| 68 | - * listener will be triggered in the chain (defaults to 0) |
|
| 69 | - * |
|
| 70 | - * @since 17.0.0 |
|
| 71 | - */ |
|
| 72 | - public function addServiceListener(string $eventName, string $className, int $priority = 0): void; |
|
| 61 | + /** |
|
| 62 | + * @template T of \OCP\EventDispatcher\Event |
|
| 63 | + * @param string $eventName preferably the fully-qualified class name of the Event sub class to listen for |
|
| 64 | + * @psalm-param string|class-string<T> $eventName preferably the fully-qualified class name of the Event sub class to listen for |
|
| 65 | + * @param string $className fully qualified class name (or ::class notation) of a \OCP\EventDispatcher\IEventListener that can be built by the DI container |
|
| 66 | + * @psalm-param class-string<\OCP\EventDispatcher\IEventListener<T>> $className fully qualified class name that can be built by the DI container |
|
| 67 | + * @param int $priority The higher this value, the earlier an event |
|
| 68 | + * listener will be triggered in the chain (defaults to 0) |
|
| 69 | + * |
|
| 70 | + * @since 17.0.0 |
|
| 71 | + */ |
|
| 72 | + public function addServiceListener(string $eventName, string $className, int $priority = 0): void; |
|
| 73 | 73 | |
| 74 | - /** |
|
| 75 | - * @template T of \OCP\EventDispatcher\Event |
|
| 76 | - * @param string $eventName |
|
| 77 | - * @psalm-param string|class-string<T> $eventName |
|
| 78 | - * @param Event $event |
|
| 79 | - * @psalm-param T $event |
|
| 80 | - * |
|
| 81 | - * @since 17.0.0 |
|
| 82 | - * @deprecated 21.0.0 use \OCP\EventDispatcher\IEventDispatcher::dispatchTyped |
|
| 83 | - */ |
|
| 84 | - public function dispatch(string $eventName, Event $event): void; |
|
| 74 | + /** |
|
| 75 | + * @template T of \OCP\EventDispatcher\Event |
|
| 76 | + * @param string $eventName |
|
| 77 | + * @psalm-param string|class-string<T> $eventName |
|
| 78 | + * @param Event $event |
|
| 79 | + * @psalm-param T $event |
|
| 80 | + * |
|
| 81 | + * @since 17.0.0 |
|
| 82 | + * @deprecated 21.0.0 use \OCP\EventDispatcher\IEventDispatcher::dispatchTyped |
|
| 83 | + */ |
|
| 84 | + public function dispatch(string $eventName, Event $event): void; |
|
| 85 | 85 | |
| 86 | - /** |
|
| 87 | - * Dispatch a typed event |
|
| 88 | - * |
|
| 89 | - * Only use this with subclasses of ``\OCP\EventDispatcher\Event``. |
|
| 90 | - * The object's class will determine the event name. |
|
| 91 | - * |
|
| 92 | - * @param Event $event |
|
| 93 | - * |
|
| 94 | - * @since 18.0.0 |
|
| 95 | - */ |
|
| 96 | - public function dispatchTyped(Event $event): void; |
|
| 86 | + /** |
|
| 87 | + * Dispatch a typed event |
|
| 88 | + * |
|
| 89 | + * Only use this with subclasses of ``\OCP\EventDispatcher\Event``. |
|
| 90 | + * The object's class will determine the event name. |
|
| 91 | + * |
|
| 92 | + * @param Event $event |
|
| 93 | + * |
|
| 94 | + * @since 18.0.0 |
|
| 95 | + */ |
|
| 96 | + public function dispatchTyped(Event $event): void; |
|
| 97 | 97 | } |