From 2fa4b3bcacbcd8e2eac5e517d7da7747ac4f1bf8 Mon Sep 17 00:00:00 2001 From: Daniel Subiabre Date: Wed, 9 Oct 2024 15:52:13 +0200 Subject: [PATCH] Code style fixes --- src/Command/BenzinaPumpCommand.php | 4 ++-- src/Library/Benzina/Pump/CheckoutsPump.php | 3 ++- src/Library/Benzina/Pump/ProjectsPump.php | 3 ++- src/Library/Benzina/Pump/PumpInterface.php | 3 ++- src/Library/Benzina/Pump/Trait/DoctrinePumpTrait.php | 11 ++++++----- src/Library/Benzina/Pump/UsersPump.php | 3 ++- 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/Command/BenzinaPumpCommand.php b/src/Command/BenzinaPumpCommand.php index 171101e..9fe923b 100644 --- a/src/Command/BenzinaPumpCommand.php +++ b/src/Command/BenzinaPumpCommand.php @@ -137,7 +137,7 @@ EOF foreach ($pumps as $key => $pump) { $pump->setConfig([ - 'skip-pumped' => $input->getOption('skip-pumped') + 'skip-pumped' => $input->getOption('skip-pumped'), ]); $pump->pump($batch); @@ -167,7 +167,7 @@ EOF if (preg_match('/^(\d+)(.)$/', $limit, $matches)) { if ($matches[2] == 'M') { $limit = $matches[1] * 1024 * 1024; // nnnM -> nnn MB - } else if ($matches[2] == 'K') { + } elseif ($matches[2] == 'K') { $limit = $matches[1] * 1024; // nnnK -> nnn KB } } diff --git a/src/Library/Benzina/Pump/CheckoutsPump.php b/src/Library/Benzina/Pump/CheckoutsPump.php index 11c9a4f..e4c3632 100644 --- a/src/Library/Benzina/Pump/CheckoutsPump.php +++ b/src/Library/Benzina/Pump/CheckoutsPump.php @@ -75,7 +75,8 @@ class CheckoutsPump extends AbstractPump implements PumpInterface private ProjectRepository $projectRepository, private TipjarRepository $tipjarRepository, private EntityManagerInterface $entityManager, - ) {} + ) { + } public function supports(mixed $batch): bool { diff --git a/src/Library/Benzina/Pump/ProjectsPump.php b/src/Library/Benzina/Pump/ProjectsPump.php index 515a956..f6cb1f0 100644 --- a/src/Library/Benzina/Pump/ProjectsPump.php +++ b/src/Library/Benzina/Pump/ProjectsPump.php @@ -97,7 +97,8 @@ 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/PumpInterface.php b/src/Library/Benzina/Pump/PumpInterface.php index 9af9455..163ee88 100644 --- a/src/Library/Benzina/Pump/PumpInterface.php +++ b/src/Library/Benzina/Pump/PumpInterface.php @@ -13,8 +13,9 @@ interface PumpInterface /** * Read the configuration values for this pump. - * + * * @param string|null $key A configuration array key to return + * * @return array The configuration array at the specified key, or all keys if null */ public function getConfig(?string $key = null): array; diff --git a/src/Library/Benzina/Pump/Trait/DoctrinePumpTrait.php b/src/Library/Benzina/Pump/Trait/DoctrinePumpTrait.php index 453b346..61e2e78 100644 --- a/src/Library/Benzina/Pump/Trait/DoctrinePumpTrait.php +++ b/src/Library/Benzina/Pump/Trait/DoctrinePumpTrait.php @@ -11,17 +11,18 @@ trait DoctrinePumpTrait private EntityManagerInterface $entityManager, ) { if (!$this instanceof PumpInterface) { - throw new \Exception("DoctrinePumpTrait can only be used with PumpInterface classes"); + throw new \Exception('DoctrinePumpTrait can only be used with PumpInterface classes'); } } /** * Skip already pumped records from a pumping stream batch. * - * @param array $batch The batch of records being pumped - * @param array $batchKey The key in the batch records to match against the entity key - * @param string $entityClass The class where the data is being pumped to - * @param string $entityKey The property of the pumped to class to match against the batch key + * @param array $batch The batch of records being pumped + * @param array $batchKey The key in the batch records to match against the entity key + * @param string $entityClass The class where the data is being pumped to + * @param string $entityKey The property of the pumped to class to match against the batch key + * * @return array The batch of records being pumped, sliced out of already pumped records */ public function skipPumped( diff --git a/src/Library/Benzina/Pump/UsersPump.php b/src/Library/Benzina/Pump/UsersPump.php index 9e42a6b..14485b5 100644 --- a/src/Library/Benzina/Pump/UsersPump.php +++ b/src/Library/Benzina/Pump/UsersPump.php @@ -52,7 +52,8 @@ class UsersPump extends AbstractPump implements PumpInterface public function __construct( private EntityManagerInterface $entityManager, - ) {} + ) { + } public function supports(mixed $batch): bool {