summaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-02-16 15:51:25 +0100
committerJoas Schilling <coding@schilljs.com>2021-02-16 15:51:25 +0100
commit89d2eaca0afca978d03d2e249ec961561647307d (patch)
tree2755d1301a8035ad193619a7a8cb7c8eddf2e530 /apps/provisioning_api
parentbe0002d0967b180b9bfd04a9cc8f3e88fe20ec0e (diff)
downloadnextcloud-server-89d2eaca0afca978d03d2e249ec961561647307d.tar.gz
nextcloud-server-89d2eaca0afca978d03d2e249ec961561647307d.zip
Cleanup appinfo usage
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/provisioning_api')
-rw-r--r--apps/provisioning_api/lib/Controller/AUserData.php5
-rw-r--r--apps/provisioning_api/lib/Controller/AppsController.php18
2 files changed, 10 insertions, 13 deletions
diff --git a/apps/provisioning_api/lib/Controller/AUserData.php b/apps/provisioning_api/lib/Controller/AUserData.php
index b7b31b18b53..5e6af27cf72 100644
--- a/apps/provisioning_api/lib/Controller/AUserData.php
+++ b/apps/provisioning_api/lib/Controller/AUserData.php
@@ -32,6 +32,7 @@ declare(strict_types=1);
namespace OCA\Provisioning_API\Controller;
use OC\Accounts\AccountManager;
+use OC\Group\Manager;
use OC\User\Backend;
use OC\User\NoUserException;
use OC_Helper;
@@ -55,7 +56,7 @@ abstract class AUserData extends OCSController {
protected $userManager;
/** @var IConfig */
protected $config;
- /** @var IGroupManager|\OC\Group\Manager */ // FIXME Requires a method that is not on the interface
+ /** @var IGroupManager|Manager */ // FIXME Requires a method that is not on the interface
protected $groupManager;
/** @var IUserSession */
protected $userSession;
@@ -182,7 +183,7 @@ abstract class AUserData extends OCSController {
/**
* @param string $userId
* @return array
- * @throws \OCP\Files\NotFoundException
+ * @throws OCSException
*/
protected function fillStorageInfo(string $userId): array {
try {
diff --git a/apps/provisioning_api/lib/Controller/AppsController.php b/apps/provisioning_api/lib/Controller/AppsController.php
index e7383fd355b..d0c91c3cee8 100644
--- a/apps/provisioning_api/lib/Controller/AppsController.php
+++ b/apps/provisioning_api/lib/Controller/AppsController.php
@@ -31,6 +31,7 @@ declare(strict_types=1);
namespace OCA\Provisioning_API\Controller;
use OC_App;
+use OCP\API;
use OCP\App\AppPathNotFoundException;
use OCP\App\IAppManager;
use OCP\AppFramework\Http\DataResponse;
@@ -39,14 +40,9 @@ use OCP\AppFramework\OCSController;
use OCP\IRequest;
class AppsController extends OCSController {
- /** @var \OCP\App\IAppManager */
+ /** @var IAppManager */
private $appManager;
- /**
- * @param string $appName
- * @param IRequest $request
- * @param IAppManager $appManager
- */
public function __construct(
string $appName,
IRequest $request,
@@ -58,7 +54,7 @@ class AppsController extends OCSController {
}
/**
- * @param string $filter
+ * @param string|null $filter
* @return DataResponse
* @throws OCSException
*/
@@ -92,12 +88,12 @@ class AppsController extends OCSController {
* @throws OCSException
*/
public function getAppInfo(string $app): DataResponse {
- $info = \OCP\App::getAppInfo($app);
+ $info = $this->appManager->getAppInfo($app);
if (!is_null($info)) {
- return new DataResponse(OC_App::getAppInfo($app));
+ return new DataResponse($info);
}
- throw new OCSException('The request app was not found', \OCP\API::RESPOND_NOT_FOUND);
+ throw new OCSException('The request app was not found', API::RESPOND_NOT_FOUND);
}
/**
@@ -110,7 +106,7 @@ class AppsController extends OCSController {
try {
$this->appManager->enableApp($app);
} catch (AppPathNotFoundException $e) {
- throw new OCSException('The request app was not found', \OCP\API::RESPOND_NOT_FOUND);
+ throw new OCSException('The request app was not found', API::RESPOND_NOT_FOUND);
}
return new DataResponse();
}