From 1e989bd37b829ed839e0c87b4db0d74f1e95d405 Mon Sep 17 00:00:00 2001 From: Michiel Kodde Date: Wed, 28 Aug 2024 14:25:20 +0200 Subject: [PATCH] Address CodeStyle issues --- src/OpenConext/Kernel.php | 1 - .../FindUserInformationQueryHandler.php | 3 +-- .../QueryHandler/InactiveUsersQueryHandler.php | 3 +-- .../Application/Service/DeprovisionService.php | 3 +-- .../Domain/ValueObject/Client/Name.php | 1 - .../Domain/ValueObject/CollabPersonId.php | 4 +--- .../Domain/ValueObject/InactivityPeriod.php | 2 -- .../Command/DeprovisionCommand.php | 18 +++++++++--------- 8 files changed, 13 insertions(+), 22 deletions(-) diff --git a/src/OpenConext/Kernel.php b/src/OpenConext/Kernel.php index c2733c6..b8c5a16 100644 --- a/src/OpenConext/Kernel.php +++ b/src/OpenConext/Kernel.php @@ -38,5 +38,4 @@ public function getLogDir(): string { return $this->getCacheDir(); } - } diff --git a/src/OpenConext/UserLifecycle/Application/QueryHandler/FindUserInformationQueryHandler.php b/src/OpenConext/UserLifecycle/Application/QueryHandler/FindUserInformationQueryHandler.php index 3fb2a5e..e3fc0fb 100644 --- a/src/OpenConext/UserLifecycle/Application/QueryHandler/FindUserInformationQueryHandler.php +++ b/src/OpenConext/UserLifecycle/Application/QueryHandler/FindUserInformationQueryHandler.php @@ -33,8 +33,7 @@ public function __construct( public function handle( FindUserInformationQuery $query, - ): InformationResponseInterface - { + ): InformationResponseInterface { return $this->informationService->readInformationFor($query->getCollabPersonId()); } } diff --git a/src/OpenConext/UserLifecycle/Application/QueryHandler/InactiveUsersQueryHandler.php b/src/OpenConext/UserLifecycle/Application/QueryHandler/InactiveUsersQueryHandler.php index c59a17e..4fdb622 100644 --- a/src/OpenConext/UserLifecycle/Application/QueryHandler/InactiveUsersQueryHandler.php +++ b/src/OpenConext/UserLifecycle/Application/QueryHandler/InactiveUsersQueryHandler.php @@ -33,8 +33,7 @@ public function __construct( public function handle( InactiveUsersQuery $query, - ): LastLoginCollectionInterface - { + ): LastLoginCollectionInterface { return $this->lastLoginRepository->findDeprovisionCandidates($query->getInactivityPeriod()); } } diff --git a/src/OpenConext/UserLifecycle/Application/Service/DeprovisionService.php b/src/OpenConext/UserLifecycle/Application/Service/DeprovisionService.php index 359281f..cd63e8d 100644 --- a/src/OpenConext/UserLifecycle/Application/Service/DeprovisionService.php +++ b/src/OpenConext/UserLifecycle/Application/Service/DeprovisionService.php @@ -55,8 +55,7 @@ public function deprovision( ProgressReporterInterface $progressReporter, string $personId, bool $dryRun = false, - ): InformationResponseCollectionInterface - { + ): InformationResponseCollectionInterface { $this->logger->debug('Received a request to deprovision a user.'); $collabPersonId = $this->buildCollabPersonId($personId); diff --git a/src/OpenConext/UserLifecycle/Domain/ValueObject/Client/Name.php b/src/OpenConext/UserLifecycle/Domain/ValueObject/Client/Name.php index 0cf275c..465402b 100644 --- a/src/OpenConext/UserLifecycle/Domain/ValueObject/Client/Name.php +++ b/src/OpenConext/UserLifecycle/Domain/ValueObject/Client/Name.php @@ -29,7 +29,6 @@ public function __construct( private readonly string $name, ) { Assert::notEmpty(trim($name), 'Name can not be empty.'); - } public function getName(): string diff --git a/src/OpenConext/UserLifecycle/Domain/ValueObject/CollabPersonId.php b/src/OpenConext/UserLifecycle/Domain/ValueObject/CollabPersonId.php index b0c5a7d..0fe1fa7 100644 --- a/src/OpenConext/UserLifecycle/Domain/ValueObject/CollabPersonId.php +++ b/src/OpenConext/UserLifecycle/Domain/ValueObject/CollabPersonId.php @@ -31,9 +31,7 @@ class CollabPersonId implements \Stringable public function __construct( string $collabUserId, ) { - - $collabUserId = trim($collabUserId); - + $collabUserId = trim($collabUserId); if (empty($collabUserId)) { throw new InvalidCollabPersonIdException('The collabPersonId must be a non empty string'); } diff --git a/src/OpenConext/UserLifecycle/Domain/ValueObject/InactivityPeriod.php b/src/OpenConext/UserLifecycle/Domain/ValueObject/InactivityPeriod.php index c79b3ec..9c53e31 100644 --- a/src/OpenConext/UserLifecycle/Domain/ValueObject/InactivityPeriod.php +++ b/src/OpenConext/UserLifecycle/Domain/ValueObject/InactivityPeriod.php @@ -25,7 +25,6 @@ class InactivityPeriod { - public function __construct( #[Autowire(param: 'inactivity_period')] private readonly int $inactivityPeriodInMonths, @@ -33,7 +32,6 @@ public function __construct( if ($inactivityPeriodInMonths <= 0) { throw new InvalidInactivityPeriodException('The inactivity period must be an positive integer value'); } - } public function getInactivityPeriodInMonths(): int diff --git a/src/OpenConext/UserLifecycle/Infrastructure/UserLifecycleBundle/Command/DeprovisionCommand.php b/src/OpenConext/UserLifecycle/Infrastructure/UserLifecycleBundle/Command/DeprovisionCommand.php index 1637d68..df33251 100644 --- a/src/OpenConext/UserLifecycle/Infrastructure/UserLifecycleBundle/Command/DeprovisionCommand.php +++ b/src/OpenConext/UserLifecycle/Infrastructure/UserLifecycleBundle/Command/DeprovisionCommand.php @@ -44,7 +44,7 @@ public function __construct( private readonly ProgressReporterInterface $progressReporter, private readonly LoggerInterface $logger, ) { - parent::__construct(null); + parent::__construct(); } protected function configure(): void @@ -108,14 +108,14 @@ protected function execute( ); } return $this->executeSingleUser( - $input, - $output, - $userIdInput, - $dryRun, - $noInteraction, - $outputOnlyJson, - $prettyJson, - ); + $input, + $output, + $userIdInput, + $dryRun, + $noInteraction, + $outputOnlyJson, + $prettyJson, + ); } private function executeBatch(