Merge pull request #25681 from nextcloud/techdebt/noid/cleanup-provisioning
Cleanup appinfo usage
This commit is contained in:
commit
00d1a58a09
|
@ -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 {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue