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/IContainer.php | |
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/IContainer.php')
-rw-r--r-- | lib/public/IContainer.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/public/IContainer.php b/lib/public/IContainer.php index ccfe81534ec..929d3740239 100644 --- a/lib/public/IContainer.php +++ b/lib/public/IContainer.php @@ -37,6 +37,8 @@ namespace OCP; use Closure; use OCP\AppFramework\QueryException; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\ContainerInterface; /** * Class IContainer @@ -45,8 +47,9 @@ use OCP\AppFramework\QueryException; * * @package OCP * @since 6.0.0 + * @deprecated 20.0.0 use \Psr\Container\ContainerInterface */ -interface IContainer { +interface IContainer extends ContainerInterface { /** * If a parameter is not registered in the container try to instantiate it @@ -54,6 +57,8 @@ interface IContainer { * @param string $name the class name to resolve * @return \stdClass * @since 8.2.0 + * @deprecated 20.0.0 use \Psr\Container\ContainerInterface::get + * @throws ContainerExceptionInterface if the class could not be found or instantiated * @throws QueryException if the class could not be found or instantiated */ public function resolve($name); @@ -64,8 +69,10 @@ interface IContainer { * @param string $name * @param bool $autoload Should we try to autoload the service. If we are trying to resolve built in types this makes no sense for example * @return mixed + * @throws ContainerExceptionInterface if the query could not be resolved * @throws QueryException if the query could not be resolved * @since 6.0.0 + * @deprecated 20.0.0 use \Psr\Container\ContainerInterface::get */ public function query(string $name, bool $autoload = true); @@ -76,6 +83,7 @@ interface IContainer { * @param mixed $value * @return void * @since 6.0.0 + * @deprecated 20.0.0 use \OCP\AppFramework\Bootstrap\IRegistrationContext::registerParameter */ public function registerParameter($name, $value); @@ -91,6 +99,7 @@ interface IContainer { * @param bool $shared * @return void * @since 6.0.0 + * @deprecated 20.0.0 use \OCP\AppFramework\Bootstrap\IRegistrationContext::registerService */ public function registerService($name, Closure $closure, $shared = true); @@ -101,6 +110,7 @@ interface IContainer { * @param string $alias the alias that should be registered * @param string $target the target that should be resolved instead * @since 8.2.0 + * @deprecated 20.0.0 use \OCP\AppFramework\Bootstrap\IRegistrationContext::registerServiceAlias */ public function registerAlias($alias, $target); } |