summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-07-21 14:36:40 +0200
committerMorris Jobke <hey@morrisjobke.de>2020-07-21 20:44:05 +0200
commit7870ca06637453f4e72dbd67edbfb3603d813196 (patch)
tree9f61927799c9baf39e336fa4299d4ac0fe4e34a1 /lib
parent91e7f12088cb87ffef5660429ece404364167978 (diff)
downloadnextcloud-server-7870ca06637453f4e72dbd67edbfb3603d813196.tar.gz
nextcloud-server-7870ca06637453f4e72dbd67edbfb3603d813196.zip
Use the proper IAppContainer and IServerContainer type hints to know which code runs with which container
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/AppFramework/Bootstrap/BootContext.php10
-rw-r--r--lib/public/AppFramework/App.php1
-rw-r--r--lib/public/AppFramework/Bootstrap/IBootContext.php9
3 files changed, 9 insertions, 11 deletions
diff --git a/lib/private/AppFramework/Bootstrap/BootContext.php b/lib/private/AppFramework/Bootstrap/BootContext.php
index 7c2582a7269..45aaf167e75 100644
--- a/lib/private/AppFramework/Bootstrap/BootContext.php
+++ b/lib/private/AppFramework/Bootstrap/BootContext.php
@@ -26,23 +26,23 @@ declare(strict_types=1);
namespace OC\AppFramework\Bootstrap;
use OCP\AppFramework\Bootstrap\IBootContext;
+use OCP\AppFramework\IAppContainer;
use OCP\IServerContainer;
-use Psr\Container\ContainerInterface;
class BootContext implements IBootContext {
- /** @var ContainerInterface */
+ /** @var IAppContainer */
private $appContainer;
- public function __construct(ContainerInterface $appContainer) {
+ public function __construct(IAppContainer $appContainer) {
$this->appContainer = $appContainer;
}
- public function getAppContainer(): ContainerInterface {
+ public function getAppContainer(): IAppContainer {
return $this->appContainer;
}
- public function getServerContainer(): ContainerInterface {
+ public function getServerContainer(): IServerContainer {
return $this->appContainer->get(IServerContainer::class);
}
diff --git a/lib/public/AppFramework/App.php b/lib/public/AppFramework/App.php
index de1cbcb64e8..2f55fd45140 100644
--- a/lib/public/AppFramework/App.php
+++ b/lib/public/AppFramework/App.php
@@ -120,7 +120,6 @@ class App {
/**
* @return IAppContainer
* @since 6.0.0
- * @todo make this return a ContainerInterface as well
*/
public function getContainer(): IAppContainer {
return $this->container;
diff --git a/lib/public/AppFramework/Bootstrap/IBootContext.php b/lib/public/AppFramework/Bootstrap/IBootContext.php
index 86232cef4ad..80a4edf1cd6 100644
--- a/lib/public/AppFramework/Bootstrap/IBootContext.php
+++ b/lib/public/AppFramework/Bootstrap/IBootContext.php
@@ -28,7 +28,6 @@ namespace OCP\AppFramework\Bootstrap;
use OCP\AppFramework\IAppContainer;
use OCP\IServerContainer;
use Psr\Container\ContainerExceptionInterface;
-use Psr\Container\ContainerInterface;
use Throwable;
/**
@@ -41,20 +40,20 @@ interface IBootContext {
*
* Useful to register and query app-specific services
*
- * @return ContainerInterface|IAppContainer
+ * @return IAppContainer
* @since 20.0.0
*/
- public function getAppContainer(): ContainerInterface;
+ public function getAppContainer(): IAppContainer;
/**
* Get hold of the server DI container
*
* Useful to register and query system-wide services
*
- * @return ContainerInterface|IServerContainer
+ * @return IServerContainer
* @since 20.0.0
*/
- public function getServerContainer(): ContainerInterface;
+ public function getServerContainer(): IServerContainer;
/**
* Invoke the given callable and inject all parameters based on their types