Skip to content

Commit 23b08c2

Browse files
committed
Merge remote-tracking branch 'origin/master' into rector-fix
2 parents f5900b1 + fecb588 commit 23b08c2

27 files changed

+58
-145
lines changed

ecs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
arrays: true,
2828
comments: true,
2929
docblocks: true,
30-
spaces: true,
30+
// spaces: true,
3131
namespaces: true,
3232
)
3333
;

src/Command/RatioFetchCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
2929
{
3030
try {
3131
$this->pairManager->saveRatioListFromRatioProvider();
32-
$output->writeln('ratio fetched from provider'.PHP_EOL.print_r($this->pairManager->getRatioList(), true));
32+
$output->writeln('ratio fetched from provider' . PHP_EOL . print_r($this->pairManager->getRatioList(), true));
3333

3434
return Command::SUCCESS;
3535
} catch (MoneyException $e) {
36-
$output->writeln('ERROR during fetch ratio : '.$e->getMessage());
36+
$output->writeln('ERROR during fetch ratio : ' . $e->getMessage());
3737

3838
return Command::FAILURE;
3939
}

src/Command/RatioListCommand.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected function displayTxt(array $ratioList, OutputInterface $output, Symfony
4242
$io->writeln('Ratio list');
4343

4444
foreach ($ratioList as $currencyCode => $ratio) {
45-
$io->writeln($currencyCode.';'.(string) $ratio);
45+
$io->writeln($currencyCode . ';' . (string) $ratio);
4646
}
4747

4848
return Command::SUCCESS;
@@ -82,8 +82,8 @@ private function display(OutputInterface $output, SymfonyStyle $io): int
8282
$ratioList = $this->pairManager->getRatioList();
8383

8484
return match ($this->format) {
85-
'txt' => $this->displayTxt($ratioList, $output, $io),
86-
'json' => $this->displayJson($ratioList, $output),
85+
'txt' => $this->displayTxt($ratioList, $output, $io),
86+
'json' => $this->displayJson($ratioList, $output),
8787
'table' => $this->displayTable($ratioList, $output, $io),
8888
default => throw new InvalidArgumentException(sprintf('Supported formats are "%s".', implode('", "', $this->getAvailableFormatOptions()))),
8989
};
@@ -107,7 +107,9 @@ public function complete(CompletionInput $input, CompletionSuggestions $suggesti
107107
}
108108
}
109109

110-
/** @return list<string|Suggestion> $values */
110+
/**
111+
* @return list<string|Suggestion> $values
112+
*/
111113
private function getAvailableFormatOptions(): array
112114
{
113115
return ['txt', 'json', 'table'];

src/Command/RatioSaveCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
4747

4848
return Command::SUCCESS;
4949
} catch (MoneyException $e) {
50-
$output->writeln('ERROR : ratio no saved du to error : '.$e->getMessage());
50+
$output->writeln('ERROR : ratio no saved du to error : ' . $e->getMessage());
5151

5252
return Command::FAILURE;
5353
}

src/DependencyInjection/Compiler/PairHistoryCompilerPass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function process(ContainerBuilder $container): void
4747
$container->setDefinition('tbbc_money.pair_history_manager', $pairHistoryDefinition);
4848

4949
//Add doctrine schema mappings
50-
$modelDir = (string) realpath(__DIR__.'/../../Resources/config/doctrine/ratios');
50+
$modelDir = (string) realpath(__DIR__ . '/../../Resources/config/doctrine/ratios');
5151
$path = DoctrineOrmMappingsPass::createXmlMappingDriver([
5252
$modelDir => 'Tbbc\MoneyBundle\Entity',
5353
]);
@@ -70,7 +70,7 @@ public function process(ContainerBuilder $container): void
7070
$container->setDefinition('tbbc_money.pair_history_manager', $pairHistoryDefinition);
7171

7272
//Add document schema mappings
73-
$modelDir = (string) realpath(__DIR__.'/../../Resources/config/document/ratios');
73+
$modelDir = (string) realpath(__DIR__ . '/../../Resources/config/document/ratios');
7474
$path = DoctrineMongoDBMappingsPass::createXmlMappingDriver([
7575
$modelDir => 'Tbbc\MoneyBundle\Document',
7676
], [

src/DependencyInjection/Compiler/StorageCompilerPass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function process(ContainerBuilder $container): void
2828
}
2929

3030
//Add doctrine schema mappings
31-
$modelDir = (string) realpath(__DIR__.'/../../Resources/config/doctrine/ratios');
31+
$modelDir = (string) realpath(__DIR__ . '/../../Resources/config/doctrine/ratios');
3232
$path = DoctrineOrmMappingsPass::createXmlMappingDriver([
3333
$modelDir => 'Tbbc\MoneyBundle\Entity',
3434
]);
@@ -50,7 +50,7 @@ public function process(ContainerBuilder $container): void
5050
}
5151

5252
//Add document schema mappings
53-
$modelDir = (string) realpath(__DIR__.'/../../Resources/config/document/ratios');
53+
$modelDir = (string) realpath(__DIR__ . '/../../Resources/config/document/ratios');
5454
$path = DoctrineMongoDBMappingsPass::createXmlMappingDriver([
5555
$modelDir => 'Tbbc\MoneyBundle\Document',
5656
], [

src/DependencyInjection/TbbcMoneyExtension.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,12 @@
1616
*/
1717
class TbbcMoneyExtension extends Extension
1818
{
19-
/**
20-
* {@inheritDoc}
21-
*/
2219
public function load(array $configs, ContainerBuilder $container): void
2320
{
2421
$configuration = new Configuration();
2522
$config = $this->processConfiguration($configuration, $configs);
2623

27-
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
24+
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
2825
$loader->load('services.xml');
2926
$loader->load('form_types.xml');
3027
$loader->load('twig_extension.xml');

src/Form/DataTransformer/CurrencyToArrayTransformer.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@
1313

1414
/**
1515
* Transforms between a Currency and an array.
16-
*
16+
*
1717
* @implements DataTransformerInterface<Currency, array>
1818
*/
1919
class CurrencyToArrayTransformer implements DataTransformerInterface
2020
{
2121
/**
22-
* {@inheritdoc}
23-
*
2422
* @psalm-param Currency|null $value
2523
*/
2624
public function transform(mixed $value): ?array
@@ -32,12 +30,12 @@ public function transform(mixed $value): ?array
3230
throw new UnexpectedTypeException($value, 'Currency');
3331
}
3432

35-
return ['tbbc_name' => $value->getCode()];
33+
return [
34+
'tbbc_name' => $value->getCode(),
35+
];
3636
}
3737

3838
/**
39-
* {@inheritdoc}
40-
*
4139
* @psalm-param array|null $value
4240
*/
4341
public function reverseTransform(mixed $value): ?Currency

src/Form/DataTransformer/MoneyToArrayTransformer.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
/**
1515
* Transforms between a Money and an array.
16-
*
16+
*
1717
* @implements DataTransformerInterface<Money, array>
1818
*/
1919
class MoneyToArrayTransformer implements DataTransformerInterface
@@ -26,10 +26,8 @@ public function __construct(protected int $decimals = 2)
2626
}
2727

2828
/**
29-
* {@inheritdoc}
30-
*
3129
* @psalm-param Money|null $value
32-
*
30+
*
3331
* @psalm-return array{tbbc_amount: string, tbbc_currency: Currency}|array{tbbc_amount: string}|null
3432
*/
3533
public function transform(mixed $value): ?array
@@ -51,8 +49,6 @@ public function transform(mixed $value): ?array
5149
}
5250

5351
/**
54-
* {@inheritdoc}
55-
*
5652
* @psalm-param array|null $value
5753
*/
5854
public function reverseTransform(mixed $value): ?Money

src/Form/DataTransformer/SimpleMoneyToArrayTransformer.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ public function __construct(protected int $decimals)
1919
}
2020

2121
/**
22-
* {@inheritdoc}
23-
*
2422
* @psalm-param Money|null $value
25-
*
23+
*
2624
* @psalm-return array{tbbc_amount: string}|null
2725
*/
2826
public function transform(mixed $value): ?array
@@ -37,8 +35,6 @@ public function transform(mixed $value): ?array
3735
}
3836

3937
/**
40-
* {@inheritdoc}
41-
*
4238
* @psalm-param array|null $value
4339
*/
4440
public function reverseTransform(mixed $value): ?Money

0 commit comments

Comments
 (0)