diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-07-13 11:18:14 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-07-16 13:35:45 +0200 |
commit | 4152216bd8cf9d49e6749d26bb8b491dd49b089b (patch) | |
tree | 3b626622b1c22dad13bcc07bf7bdcd7bccb96bf3 /lib/public/AppFramework | |
parent | b12d3691c332480bc20e341b1bc23cb75977f148 (diff) | |
download | nextcloud-server-4152216bd8cf9d49e6749d26bb8b491dd49b089b.tar.gz nextcloud-server-4152216bd8cf9d49e6749d26bb8b491dd49b089b.zip |
Use PSR container interface and deprecate our own abstraction
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/public/AppFramework')
-rw-r--r-- | lib/public/AppFramework/Bootstrap/IBootContext.php | 7 | ||||
-rw-r--r-- | lib/public/AppFramework/IAppContainer.php | 5 | ||||
-rw-r--r-- | lib/public/AppFramework/QueryException.php | 9 |
3 files changed, 17 insertions, 4 deletions
diff --git a/lib/public/AppFramework/Bootstrap/IBootContext.php b/lib/public/AppFramework/Bootstrap/IBootContext.php index 47b26528c66..ee0bef6a5fa 100644 --- a/lib/public/AppFramework/Bootstrap/IBootContext.php +++ b/lib/public/AppFramework/Bootstrap/IBootContext.php @@ -26,8 +26,9 @@ declare(strict_types=1); namespace OCP\AppFramework\Bootstrap; use OCP\AppFramework\IAppContainer; -use OCP\AppFramework\QueryException; use OCP\IServerContainer; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\ContainerInterface; use Throwable; /** @@ -40,7 +41,7 @@ interface IBootContext { * * Useful to register and query app-specific services * - * @return IAppContainer + * @return IAppContainer|ContainerInterface * @since 20.0.0 */ public function getAppContainer(): IAppContainer; @@ -68,7 +69,7 @@ interface IBootContext { * Note: the app container will be queried * * @param callable $fn - * @throws QueryException if at least one of the parameter can't be resolved + * @throws ContainerExceptionInterface if at least one of the parameter can't be resolved * @throws Throwable any error the function invocation might cause * @return mixed|null the return value of the invoked function, if any * @since 20.0.0 diff --git a/lib/public/AppFramework/IAppContainer.php b/lib/public/AppFramework/IAppContainer.php index b749c9fd7a6..2a3689e7063 100644 --- a/lib/public/AppFramework/IAppContainer.php +++ b/lib/public/AppFramework/IAppContainer.php @@ -34,6 +34,7 @@ use OCP\IContainer; * * This container interface provides short cuts for app developers to access predefined app service. * @since 6.0.0 + * @deprecated 20.0.0 use \Psr\Container\ContainerInterface */ interface IAppContainer extends IContainer { @@ -41,12 +42,14 @@ interface IAppContainer extends IContainer { * used to return the appname of the set application * @return string the name of your application * @since 6.0.0 + * @deprecated 20.0.0 */ public function getAppName(); /** * @return \OCP\IServerContainer * @since 6.0.0 + * @deprecated 20.0.0 */ public function getServer(); @@ -54,6 +57,7 @@ interface IAppContainer extends IContainer { * @param string $middleWare * @return boolean * @since 6.0.0 + * @deprecated 20.0.0 use \OCP\AppFramework\Bootstrap\IRegistrationContext::registerMiddleware */ public function registerMiddleWare($middleWare); @@ -62,6 +66,7 @@ interface IAppContainer extends IContainer { * * @param string $serviceName e.g. 'OCA\Files\Capabilities' * @since 8.2.0 + * @deprecated 20.0.0 use \OCP\AppFramework\Bootstrap\IRegistrationContext::registerCapability */ public function registerCapability($serviceName); } diff --git a/lib/public/AppFramework/QueryException.php b/lib/public/AppFramework/QueryException.php index 1bb03b8f217..c4f401532be 100644 --- a/lib/public/AppFramework/QueryException.php +++ b/lib/public/AppFramework/QueryException.php @@ -1,4 +1,7 @@ <?php + +declare(strict_types=1); + /** * @copyright Copyright (c) 2016, ownCloud, Inc. * @@ -25,12 +28,16 @@ namespace OCP\AppFramework; use Exception; +use Psr\Container\ContainerExceptionInterface; /** * Class QueryException * + * The class extends `NotFoundExceptionInterface` since 20.0.0 + * * @package OCP\AppFramework * @since 8.1.0 + * @deprecated 20.0.0 catch \Psr\Container\ContainerExceptionInterface */ -class QueryException extends Exception { +class QueryException extends Exception implements ContainerExceptionInterface { } |