Update service provider

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2025-04-29 16:32:53 +02:00
parent 8711eae4d8
commit 87f86d8117
5 changed files with 303 additions and 64 deletions
+8 -1
View File
@@ -15,7 +15,14 @@
### ArcaneServiceProvider
- [BREAKING] `ArcaneServiceProvider.of(context)` now returns a nullable instance, rather than throwing an exception.
- [NEW] Added a new `ArcaneServiceProvider.maybeOf(context)` getter which returns a nullable `ArcaneServiceProvider` instance.
- [NEW] `ArcaneServiceProvider` now includes a `serviceOfType<T>(context)` getter to retrieve a nullable registered service instance.
- [NEW] An `addService` method was added to `ArcaneServiceProvider`
- [NEW] A `setServices` method was added to `ArcaneServiceProvider`. Invoking this method with a list of `ArcaneService` instances will replace all existing services in the `ArcaneServiceProvider`.
- [DEPRECATED] `context.serviceOfType<T>` has been deprecated in favor of `context.service<T>`.
- [NEW] `context.requiredService<T>` has been added to provide a mechanism for ensuring a particular service has been registered.
- [NEW] `ArcaneService<T>.of(context)` has been added for easy access to service instances. It returns a nullable service instance.
- [NEW] `ArcaneService<T>.requiredOf(context)` has been added. It returns a non-nullable service instance, and throws an exception if the service instance has not been registered.
### Authentication Service (ArcaneAuth)