Refactors controllers by using PHP8's constructor property promotion.

Co-authored-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
Signed-off-by: Faraz Samapoor <fsa@adlas.at>
This commit is contained in:
Faraz Samapoor
2023-07-14 15:41:25 +03:30
parent 90d051f8e4
commit 559579fbd9
17 changed files with 91 additions and 139 deletions

View File

@@ -32,17 +32,13 @@ use OCP\AppFramework\OCSController;
use OCP\IRequest;
class OverviewApiController extends OCSController {
/** @var OverviewService */
private $dashboardService;
/** @var string */
private $userId;
public function __construct($appName, IRequest $request, OverviewService $dashboardService, $userId) {
public function __construct(
$appName,
IRequest $request,
private OverviewService $dashboardService,
private $userId,
) {
parent::__construct($appName, $request);
$this->dashboardService = $dashboardService;
$this->userId = $userId;
}
/**