From c0a5bdea5e8c0ad50cd3237edd167a4d8b679049 Mon Sep 17 00:00:00 2001 From: Faraz Samapoor Date: Mon, 12 Jun 2023 18:40:19 +0330 Subject: Uses PHP8's constructor property promotion. in core/Command/Info, /Integrity, and /Preview classes. Signed-off-by: Faraz Samapoor --- core/Command/Integrity/CheckApp.php | 5 +---- core/Command/Integrity/CheckCore.php | 5 +---- core/Command/Integrity/SignApp.php | 15 +++++---------- core/Command/Integrity/SignCore.php | 11 ++++------- 4 files changed, 11 insertions(+), 25 deletions(-) (limited to 'core/Command/Integrity') diff --git a/core/Command/Integrity/CheckApp.php b/core/Command/Integrity/CheckApp.php index ebd502c3d29..e095c6d9c31 100644 --- a/core/Command/Integrity/CheckApp.php +++ b/core/Command/Integrity/CheckApp.php @@ -40,11 +40,8 @@ use Symfony\Component\Console\Output\OutputInterface; * @package OC\Core\Command\Integrity */ class CheckApp extends Base { - private Checker $checker; - - public function __construct(Checker $checker) { + public function __construct(private Checker $checker) { parent::__construct(); - $this->checker = $checker; } /** diff --git a/core/Command/Integrity/CheckCore.php b/core/Command/Integrity/CheckCore.php index 9436786cad9..c962b80fa3c 100644 --- a/core/Command/Integrity/CheckCore.php +++ b/core/Command/Integrity/CheckCore.php @@ -36,11 +36,8 @@ use Symfony\Component\Console\Output\OutputInterface; * @package OC\Core\Command\Integrity */ class CheckCore extends Base { - private Checker $checker; - - public function __construct(Checker $checker) { + public function __construct(private Checker $checker) { parent::__construct(); - $this->checker = $checker; } /** diff --git a/core/Command/Integrity/SignApp.php b/core/Command/Integrity/SignApp.php index 8492511d597..ebdc714c8c2 100644 --- a/core/Command/Integrity/SignApp.php +++ b/core/Command/Integrity/SignApp.php @@ -40,17 +40,12 @@ use Symfony\Component\Console\Output\OutputInterface; * @package OC\Core\Command\Integrity */ class SignApp extends Command { - private Checker $checker; - private FileAccessHelper $fileAccessHelper; - private IURLGenerator $urlGenerator; - - public function __construct(Checker $checker, - FileAccessHelper $fileAccessHelper, - IURLGenerator $urlGenerator) { + public function __construct( + private Checker $checker, + private FileAccessHelper $fileAccessHelper, + private IURLGenerator $urlGenerator, + ) { parent::__construct(null); - $this->checker = $checker; - $this->fileAccessHelper = $fileAccessHelper; - $this->urlGenerator = $urlGenerator; } protected function configure() { diff --git a/core/Command/Integrity/SignCore.php b/core/Command/Integrity/SignCore.php index 55d356fcd6b..48cfcadd10d 100644 --- a/core/Command/Integrity/SignCore.php +++ b/core/Command/Integrity/SignCore.php @@ -39,14 +39,11 @@ use Symfony\Component\Console\Output\OutputInterface; * @package OC\Core\Command\Integrity */ class SignCore extends Command { - private Checker $checker; - private FileAccessHelper $fileAccessHelper; - - public function __construct(Checker $checker, - FileAccessHelper $fileAccessHelper) { + public function __construct( + private Checker $checker, + private FileAccessHelper $fileAccessHelper, + ) { parent::__construct(null); - $this->checker = $checker; - $this->fileAccessHelper = $fileAccessHelper; } protected function configure() { -- cgit v1.2.3