Code style fixes

This commit is contained in:
2024-10-09 15:52:13 +02:00
parent 5c480304cf
commit 2fa4b3bcac
6 changed files with 16 additions and 11 deletions
+2 -2
View File
@@ -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
}
}
+2 -1
View File
@@ -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
{
+2 -1
View File
@@ -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
{
+2 -1
View File
@@ -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;
@@ -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(
+2 -1
View File
@@ -52,7 +52,8 @@ class UsersPump extends AbstractPump implements PumpInterface
public function __construct(
private EntityManagerInterface $entityManager,
) {}
) {
}
public function supports(mixed $batch): bool
{