Skip to content

Commit

Permalink
[TASK] Update php-cs-fixer rules
Browse files Browse the repository at this point in the history
  • Loading branch information
derhansen committed Sep 17, 2023
1 parent fb58953 commit 6c7eb51
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'declare_parentheses' => true,
'dir_constant' => true,
'function_to_constant' => ['functions' => ['get_called_class', 'get_class', 'get_class_this', 'php_sapi_name', 'phpversion', 'pi']],
'list_syntax' => ['syntax' => 'short'],
'type_declaration_spaces' => true,
'modernize_strpos' => true,
'modernize_types_casting' => true,
Expand Down Expand Up @@ -57,6 +58,7 @@
'single_space_around_construct' => true,
'single_line_comment_style' => ['comment_types' => ['hash']],
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
'single_line_empty_body' => false,
'whitespace_after_comma_in_array' => ['ensure_single_space' => true],
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
])
Expand Down
16 changes: 8 additions & 8 deletions Tests/Unit/Service/RegistrationServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ public function checkRegistrationSuccessFailsIfRegistrationNotEnabled(): void
$event->expects(self::once())->method('getEnableRegistration')->willReturn(false);

$result = RegistrationResult::REGISTRATION_SUCCESSFUL;
list($success, $result) = $this->subject->checkRegistrationSuccess($event, $registration, $result);
[$success, $result] = $this->subject->checkRegistrationSuccess($event, $registration, $result);
self::assertFalse($success);
self::assertEquals($result, RegistrationResult::REGISTRATION_NOT_ENABLED);
}
Expand All @@ -510,7 +510,7 @@ public function checkRegistrationSuccessFailsIfRegistrationDeadlineExpired(): vo
$event->expects(self::any())->method('getRegistrationDeadline')->willReturn($deadline);

$result = RegistrationResult::REGISTRATION_SUCCESSFUL;
list($success, $result) = $this->subject->checkRegistrationSuccess($event, $registration, $result);
[$success, $result] = $this->subject->checkRegistrationSuccess($event, $registration, $result);
self::assertFalse($success);
self::assertEquals($result, RegistrationResult::REGISTRATION_FAILED_DEADLINE_EXPIRED);
}
Expand All @@ -529,7 +529,7 @@ public function checkRegistrationSuccessFailsIfEventExpired(): void
$event->expects(self::once())->method('getStartdate')->willReturn($startdate);

$result = RegistrationResult::REGISTRATION_SUCCESSFUL;
list($success, $result) = $this->subject->checkRegistrationSuccess($event, $registration, $result);
[$success, $result] = $this->subject->checkRegistrationSuccess($event, $registration, $result);
self::assertFalse($success);
self::assertEquals($result, RegistrationResult::REGISTRATION_FAILED_EVENT_EXPIRED);
}
Expand All @@ -556,7 +556,7 @@ public function checkRegistrationSuccessFailsIfMaxParticipantsReached(): void
$event->expects(self::any())->method('getMaxParticipants')->willReturn(10);

$result = RegistrationResult::REGISTRATION_SUCCESSFUL;
list($success, $result) = $this->subject->checkRegistrationSuccess($event, $registration, $result);
[$success, $result] = $this->subject->checkRegistrationSuccess($event, $registration, $result);
self::assertFalse($success);
self::assertEquals($result, RegistrationResult::REGISTRATION_FAILED_MAX_PARTICIPANTS);
}
Expand Down Expand Up @@ -587,7 +587,7 @@ public function checkRegistrationSuccessFailsIfAmountOfRegistrationsGreaterThanR
$event->expects(self::any())->method('getMaxParticipants')->willReturn(20);

$result = RegistrationResult::REGISTRATION_SUCCESSFUL;
list($success, $result) = $this->subject->checkRegistrationSuccess($event, $registration, $result);
[$success, $result] = $this->subject->checkRegistrationSuccess($event, $registration, $result);
self::assertFalse($success);
self::assertEquals($result, RegistrationResult::REGISTRATION_FAILED_NOT_ENOUGH_FREE_PLACES);
}
Expand Down Expand Up @@ -621,7 +621,7 @@ public function checkRegistrationSuccessFailsIfUniqueEmailCheckEnabledAndEmailRe
$mockRegistrationService->injectEventDispatcher($this->createMock(EventDispatcherInterface::class));

$result = RegistrationResult::REGISTRATION_SUCCESSFUL;
list($success, $result) = $mockRegistrationService->checkRegistrationSuccess($event, $registration, $result);
[$success, $result] = $mockRegistrationService->checkRegistrationSuccess($event, $registration, $result);
self::assertFalse($success);
self::assertEquals($result, RegistrationResult::REGISTRATION_FAILED_EMAIL_NOT_UNIQUE);
}
Expand Down Expand Up @@ -651,7 +651,7 @@ public function checkRegistrationSuccessFailsIfAmountOfRegistrationsExceedsMaxAm
$event->expects(self::once())->method('getMaxRegistrationsPerUser')->willReturn(5);

$result = RegistrationResult::REGISTRATION_SUCCESSFUL;
list($success, $result) = $this->subject->checkRegistrationSuccess($event, $registration, $result);
[$success, $result] = $this->subject->checkRegistrationSuccess($event, $registration, $result);
self::assertFalse($success);
self::assertEquals($result, RegistrationResult::REGISTRATION_FAILED_MAX_AMOUNT_REGISTRATIONS_EXCEEDED);
}
Expand All @@ -678,7 +678,7 @@ public function checkRegistrationSuccessSucceedsWhenAllConditionsMet(): void
$event->expects(self::any())->method('getMaxParticipants')->willReturn(10);

$result = RegistrationResult::REGISTRATION_SUCCESSFUL;
list($success, $result) = $this->subject->checkRegistrationSuccess($event, $registration, $result);
[$success, $result] = $this->subject->checkRegistrationSuccess($event, $registration, $result);
self::assertTrue($success);
self::assertEquals($result, RegistrationResult::REGISTRATION_SUCCESSFUL);
}
Expand Down

0 comments on commit 6c7eb51

Please sign in to comment.