Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-07-13 12:18:14 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-07-16 14:35:45 +0300
commit4152216bd8cf9d49e6749d26bb8b491dd49b089b (patch)
tree3b626622b1c22dad13bcc07bf7bdcd7bccb96bf3 /lib/public/IContainer.php
parentb12d3691c332480bc20e341b1bc23cb75977f148 (diff)
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.php12
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);
}