fix(controller): Migrate to new constructors

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2024-07-24 20:38:06 +02:00
Родитель a3f144c3a0
Коммит 1d74f5c62c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 74434EFE0D2E2205
3 изменённых файлов: 17 добавлений и 54 удалений

Просмотреть файл

@ -20,27 +20,14 @@ use OCP\IUserManager;
use OCP\Notification\IManager;
class APIController extends OCSController {
/** @var ITimeFactory */
protected $timeFactory;
/** @var IUserManager */
protected $userManager;
/** @var IManager */
protected $notificationManager;
public function __construct(
string $appName,
IRequest $request,
ITimeFactory $timeFactory,
IUserManager $userManager,
IManager $notificationManager,
protected ITimeFactory $timeFactory,
protected IUserManager $userManager,
protected IManager $notificationManager,
) {
parent::__construct($appName, $request);
$this->timeFactory = $timeFactory;
$this->userManager = $userManager;
$this->notificationManager = $notificationManager;
}
/**

Просмотреть файл

@ -32,35 +32,16 @@ use OCP\IUserSession;
*/
#[OpenAPI(scope: 'push')]
class PushController extends OCSController {
/** @var IDBConnection */
private $db;
/** @var ISession */
private $session;
/** @var IUserSession */
private $userSession;
/** @var IProvider */
private $tokenProvider;
/** @var Manager */
private $identityProof;
public function __construct(string $appName,
public function __construct(
string $appName,
IRequest $request,
IDBConnection $db,
ISession $session,
IUserSession $userSession,
IProvider $tokenProvider,
Manager $identityProof) {
protected IDBConnection $db,
protected ISession $session,
protected IUserSession $userSession,
protected IProvider $tokenProvider,
protected Manager $identityProof,
) {
parent::__construct($appName, $request);
$this->db = $db;
$this->session = $session;
$this->userSession = $userSession;
$this->tokenProvider = $tokenProvider;
$this->identityProof = $identityProof;
}
/**

Просмотреть файл

@ -20,19 +20,14 @@ use OCP\IConfig;
use OCP\IRequest;
class SettingsController extends OCSController {
protected IConfig $config;
protected SettingsMapper $settingsMapper;
protected string $userId;
public function __construct(string $appName,
public function __construct(
string $appName,
IRequest $request,
IConfig $config,
SettingsMapper $settingsMapper,
string $userId) {
protected IConfig $config,
protected SettingsMapper $settingsMapper,
protected string $userId,
) {
parent::__construct($appName, $request);
$this->config = $config;
$this->settingsMapper = $settingsMapper;
$this->userId = $userId;
}
/**