From 6e95ac42c97f640f2a45b53d97abe4824435d8df Mon Sep 17 00:00:00 2001 From: Daniel Subiabre Date: Fri, 11 Oct 2024 11:27:04 +0200 Subject: [PATCH] Allow single line on empty function body --- .php-cs-fixer.dist.php | 1 + src/ApiResource/Gateway.php | 4 +--- src/ApiResource/Version.php | 3 +-- src/Command/SystemVarsListCommand.php | 4 +--- src/Controller/GatewaysController.php | 3 +-- src/DependencyInjection/SystemVariablesLoader.php | 3 +-- src/Library/Benzina/Pump/CheckoutsPump.php | 3 +-- src/Library/Benzina/Pump/ProjectsPump.php | 3 +-- src/Library/Benzina/Pump/UsersPump.php | 3 +-- src/Library/Economy/Payment/PaypalGateway.php | 3 +-- src/OpenApi/OpenApiFactory.php | 4 +--- src/Security/AccessTokenHandler.php | 4 +--- src/Service/Auth/AuthService.php | 3 +-- src/Service/GatewayCheckoutService.php | 3 +-- src/State/GatewayCheckoutProcessor.php | 3 +-- src/State/GatewayStateProvider.php | 3 +-- src/State/UserStateProcessor.php | 3 +-- src/State/UserTokenLoginProcessor.php | 3 +-- src/Validator/GatewayNameValidator.php | 3 +-- 19 files changed, 19 insertions(+), 40 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index b8c750c..97cb0b0 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -8,6 +8,7 @@ return (new PhpCsFixer\Config()) ->setRules([ '@Symfony' => true, 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'], + 'single_line_empty_body' => true, 'yoda_style' => [ 'equal' => false, 'identical' => false, diff --git a/src/ApiResource/Gateway.php b/src/ApiResource/Gateway.php index a143a64..f5917f8 100644 --- a/src/ApiResource/Gateway.php +++ b/src/ApiResource/Gateway.php @@ -17,9 +17,7 @@ use App\State\GatewayStateProvider; #[API\Get(provider: GatewayStateProvider::class)] class Gateway { - public function __construct(private readonly GatewayInterface $gateway) - { - } + public function __construct(private readonly GatewayInterface $gateway) {} #[API\ApiProperty(identifier: true)] public function getName(): string diff --git a/src/ApiResource/Version.php b/src/ApiResource/Version.php index b94e121..71e6437 100644 --- a/src/ApiResource/Version.php +++ b/src/ApiResource/Version.php @@ -24,8 +24,7 @@ class Version public function __construct( private readonly LogEntry $log, private readonly object $entity, - ) { - } + ) {} /** * The ID of the version record. diff --git a/src/Command/SystemVarsListCommand.php b/src/Command/SystemVarsListCommand.php index 1be82e6..06a805b 100644 --- a/src/Command/SystemVarsListCommand.php +++ b/src/Command/SystemVarsListCommand.php @@ -21,9 +21,7 @@ class SystemVarsListCommand extends Command parent::__construct(); } - protected function configure(): void - { - } + protected function configure(): void {} protected function execute(InputInterface $input, OutputInterface $output): int { diff --git a/src/Controller/GatewaysController.php b/src/Controller/GatewaysController.php index 1c65c4e..4640201 100644 --- a/src/Controller/GatewaysController.php +++ b/src/Controller/GatewaysController.php @@ -19,8 +19,7 @@ class GatewaysController extends AbstractController public function __construct( private GatewayLocator $gatewayLocator, - ) { - } + ) {} #[Route('/gateway_redirects', name: self::REDIRECT)] public function handleRedirect(Request $request): Response diff --git a/src/DependencyInjection/SystemVariablesLoader.php b/src/DependencyInjection/SystemVariablesLoader.php index a877679..0db83d9 100644 --- a/src/DependencyInjection/SystemVariablesLoader.php +++ b/src/DependencyInjection/SystemVariablesLoader.php @@ -15,8 +15,7 @@ final class SystemVariablesLoader implements EnvVarLoaderInterface { public function __construct( private SystemVariableRepository $systemVarRepository, - ) { - } + ) {} public function loadEnvVars(): array { diff --git a/src/Library/Benzina/Pump/CheckoutsPump.php b/src/Library/Benzina/Pump/CheckoutsPump.php index 3d50f4d..b1fa028 100644 --- a/src/Library/Benzina/Pump/CheckoutsPump.php +++ b/src/Library/Benzina/Pump/CheckoutsPump.php @@ -76,8 +76,7 @@ class CheckoutsPump extends AbstractPump implements PumpInterface private TipjarRepository $tipjarRepository, private EntityManagerInterface $entityManager, private GatewayCheckoutService $checkoutService, - ) { - } + ) {} public function supports(mixed $batch): bool { diff --git a/src/Library/Benzina/Pump/ProjectsPump.php b/src/Library/Benzina/Pump/ProjectsPump.php index a93870c..cb31167 100644 --- a/src/Library/Benzina/Pump/ProjectsPump.php +++ b/src/Library/Benzina/Pump/ProjectsPump.php @@ -97,8 +97,7 @@ class ProjectsPump extends AbstractPump implements PumpInterface public function __construct( private UserRepository $userRepository, private EntityManagerInterface $entityManager, - ) { - } + ) {} public function supports(mixed $batch): bool { diff --git a/src/Library/Benzina/Pump/UsersPump.php b/src/Library/Benzina/Pump/UsersPump.php index 14485b5..9e42a6b 100644 --- a/src/Library/Benzina/Pump/UsersPump.php +++ b/src/Library/Benzina/Pump/UsersPump.php @@ -52,8 +52,7 @@ class UsersPump extends AbstractPump implements PumpInterface public function __construct( private EntityManagerInterface $entityManager, - ) { - } + ) {} public function supports(mixed $batch): bool { diff --git a/src/Library/Economy/Payment/PaypalGateway.php b/src/Library/Economy/Payment/PaypalGateway.php index 22d1236..7f2e4da 100644 --- a/src/Library/Economy/Payment/PaypalGateway.php +++ b/src/Library/Economy/Payment/PaypalGateway.php @@ -49,8 +49,7 @@ class PaypalGateway implements GatewayInterface private IriConverterInterface $iriConverter, private GatewayCheckoutService $checkoutService, private GatewayCheckoutRepository $checkoutRepository, - ) { - } + ) {} public static function getName(): string { diff --git a/src/OpenApi/OpenApiFactory.php b/src/OpenApi/OpenApiFactory.php index 1ff77c1..f001e75 100644 --- a/src/OpenApi/OpenApiFactory.php +++ b/src/OpenApi/OpenApiFactory.php @@ -12,9 +12,7 @@ use ApiPlatform\OpenApi\OpenApi; class OpenApiFactory implements OpenApiFactoryInterface { - public function __construct(private OpenApiFactoryInterface $decorated) - { - } + public function __construct(private OpenApiFactoryInterface $decorated) {} private function updateOperation(Operation $operation): Operation { diff --git a/src/Security/AccessTokenHandler.php b/src/Security/AccessTokenHandler.php index bc9488c..96f0197 100644 --- a/src/Security/AccessTokenHandler.php +++ b/src/Security/AccessTokenHandler.php @@ -9,9 +9,7 @@ use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge; class AccessTokenHandler implements AccessTokenHandlerInterface { - public function __construct(private UserTokenRepository $userTokenRepository) - { - } + public function __construct(private UserTokenRepository $userTokenRepository) {} public function getUserBadgeFrom(#[\SensitiveParameter] string $accessToken): UserBadge { diff --git a/src/Service/Auth/AuthService.php b/src/Service/Auth/AuthService.php index 5d3795f..d9e7a40 100644 --- a/src/Service/Auth/AuthService.php +++ b/src/Service/Auth/AuthService.php @@ -13,8 +13,7 @@ class AuthService public function __construct( private string $appSecret, - ) { - } + ) {} /** * @return array{CORS_ALLOW_ORIGIN: string, SESSION_LIFETIME: int} diff --git a/src/Service/GatewayCheckoutService.php b/src/Service/GatewayCheckoutService.php index 54d049b..7939bb7 100644 --- a/src/Service/GatewayCheckoutService.php +++ b/src/Service/GatewayCheckoutService.php @@ -16,8 +16,7 @@ class GatewayCheckoutService public function __construct( private RouterInterface $router, - ) { - } + ) {} /** * Generates a suitable value for redirection params to external gateways. diff --git a/src/State/GatewayCheckoutProcessor.php b/src/State/GatewayCheckoutProcessor.php index 5935fe9..f8b02c0 100644 --- a/src/State/GatewayCheckoutProcessor.php +++ b/src/State/GatewayCheckoutProcessor.php @@ -16,8 +16,7 @@ class GatewayCheckoutProcessor implements ProcessorInterface private ProcessorInterface $innerProcessor, private GatewayLocator $gatewayLocator, private EntityManagerInterface $entityManager, - ) { - } + ) {} /** * @param GatewayCheckout $data diff --git a/src/State/GatewayStateProvider.php b/src/State/GatewayStateProvider.php index 0ae771b..c9130b4 100644 --- a/src/State/GatewayStateProvider.php +++ b/src/State/GatewayStateProvider.php @@ -13,8 +13,7 @@ class GatewayStateProvider implements ProviderInterface { public function __construct( private GatewayLocator $gateways, - ) { - } + ) {} private function getGateways(): array { diff --git a/src/State/UserStateProcessor.php b/src/State/UserStateProcessor.php index 5632ec3..f9d1452 100644 --- a/src/State/UserStateProcessor.php +++ b/src/State/UserStateProcessor.php @@ -14,8 +14,7 @@ class UserStateProcessor implements ProcessorInterface public function __construct( private ProcessorInterface $innerProcessor, private UserPasswordHasherInterface $userPasswordHasher, - ) { - } + ) {} /** * @return T2 diff --git a/src/State/UserTokenLoginProcessor.php b/src/State/UserTokenLoginProcessor.php index 3c55e44..b3aa54b 100644 --- a/src/State/UserTokenLoginProcessor.php +++ b/src/State/UserTokenLoginProcessor.php @@ -21,8 +21,7 @@ class UserTokenLoginProcessor implements ProcessorInterface private UserRepository $userRepository, private EntityManagerInterface $entityManager, private UserPasswordHasherInterface $userPasswordHasher, - ) { - } + ) {} /** * @param UserTokenLoginDto $data diff --git a/src/Validator/GatewayNameValidator.php b/src/Validator/GatewayNameValidator.php index 4dfe265..7519616 100644 --- a/src/Validator/GatewayNameValidator.php +++ b/src/Validator/GatewayNameValidator.php @@ -11,8 +11,7 @@ class GatewayNameValidator extends ChoiceValidator { public function __construct( private GatewayLocator $gateways, - ) { - } + ) {} public function validate($value, Constraint $constraint): void {