Skip to content

Commit d105e8d

Browse files
Merge pull request #909 from firefly-iii/develop
🤖 Automatically merge the PR into the main branch.
2 parents 5717c78 + 9f8a49c commit d105e8d

89 files changed

Lines changed: 438 additions & 823 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ci/php-cs-fixer/.php-cs-fixer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434

3535
$config = (new PhpCsFixer\Config())
36+
// ->setUnsupportedPhpVersionAllowed(true) // use this when PHP 8.5 comes out.
3637
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
3738
;
3839
return $config->setRules(

.ci/phpcs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
2626
cd $SCRIPT_DIR/php-cs-fixer
2727
composer update --quiet
2828
rm -f .php-cs-fixer.cache
29-
PHP_CS_FIXER_IGNORE_ENV=true ./vendor/bin/php-cs-fixer fix \
29+
./vendor/bin/php-cs-fixer fix \
3030
--config $SCRIPT_DIR/php-cs-fixer/.php-cs-fixer.php \
3131
--format=txt \
3232
-v \

.github/workflows/sonarcloud.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

THANKS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Over time, many people have contributed to the Firefly III Data Importer. Their
44
Please find below all the people who contributed to the Firefly III Data Importer code. Their names are mentioned in the year of their first contribution.
55

66
## 2025
7+
- DrEthan
78
- Tamás Varga
89
- Odd Stråbø
910
- George Garside

app/Console/AutoImports.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -661,13 +661,9 @@ private function importUpload(string $jsonFile, string $importableFile): void
661661

662662
protected function isNothingDownloaded(): bool
663663
{
664-
/** @var array $errors */
665664
foreach ($this->conversionErrors as $errors) {
666-
/** @var string $error */
667-
foreach ($errors as $error) {
668-
if (str_contains($error, '[a111]')) {
669-
return true;
670-
}
665+
if (array_any($errors, fn ($error) => str_contains($error, '[a111]'))) {
666+
return true;
671667
}
672668
}
673669

@@ -676,13 +672,9 @@ protected function isNothingDownloaded(): bool
676672

677673
protected function isExpiredAgreement(): bool
678674
{
679-
/** @var array $errors */
680675
foreach ($this->conversionErrors as $errors) {
681-
/** @var string $error */
682-
foreach ($errors as $error) {
683-
if (str_contains($error, 'EUA') && str_contains($error, 'expired')) {
684-
return true;
685-
}
676+
if (array_any($errors, fn ($error) => str_contains($error, 'EUA') && str_contains($error, 'expired'))) {
677+
return true;
686678
}
687679
}
688680

app/Console/Commands/ShowVersion.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727

2828
use Illuminate\Console\Command;
2929

30+
use const PHP_SAPI;
31+
3032
/**
3133
* Class ShowVersion
3234
*/
@@ -41,7 +43,7 @@ final class ShowVersion extends Command
4143
public function handle(): int
4244
{
4345
$this->line(sprintf('Firefly III data importer v%s', config('importer.version')));
44-
$this->line(sprintf('PHP: %s %s %s', \PHP_SAPI, PHP_VERSION, PHP_OS));
46+
$this->line(sprintf('PHP: %s %s %s', PHP_SAPI, PHP_VERSION, PHP_OS));
4547

4648
return 0;
4749
}

app/Http/Controllers/DebugController.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
use Monolog\Logger;
3535
use Exception;
3636

37+
use const PHP_SAPI;
38+
3739
class DebugController extends Controller
3840
{
3941
/**
@@ -127,7 +129,7 @@ private function getSystemInfo(): array
127129
'base_build' => $baseBuild,
128130
'php_version' => str_replace($search, $replace, PHP_VERSION),
129131
'php_os' => str_replace($search, $replace, PHP_OS),
130-
'interface' => \PHP_SAPI,
132+
'interface' => PHP_SAPI,
131133
];
132134
}
133135

@@ -156,7 +158,7 @@ protected function errorReporting(int $value): string // get configuration
156158
E_COMPILE_ERROR | E_RECOVERABLE_ERROR | E_ERROR | E_CORE_ERROR => 'E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR',
157159
];
158160

159-
return $array[$value] ?? sprintf('flags: %s', (string)$value);
161+
return $array[$value] ?? sprintf('flags: %s', $value);
160162
}
161163

162164
private function getUserInfo(): array

app/Http/Controllers/Import/ConfigurationController.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,13 +366,9 @@ public function postIndex(ConfigurationPostRequest $request): RedirectResponse
366366
}
367367

368368
}
369-
370369
$configuration->updateDateRange();
371-
372370
// Map data option is now user-selectable for SimpleFIN via checkbox
373371

374-
$json = '{}';
375-
376372
try {
377373
$json = json_encode($configuration->toArray(), JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT);
378374
} catch (JsonException $e) {

app/Http/Controllers/Import/ConversionController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class ConversionController extends Controller
5656
{
5757
use RestoresConfiguration;
5858

59-
protected const DISK_NAME = 'jobs'; // TODO stored in several places
59+
protected const string DISK_NAME = 'jobs'; // TODO stored in several places
6060

6161
/**
6262
* StartController constructor.
@@ -119,7 +119,7 @@ public function index(): Application|Factory|View
119119
throw new ImporterErrorException(sprintf('Not a supported flow: "%s"', $flow));
120120
}
121121

122-
/** @var RoutineManagerInterface $routine */
122+
/** @var null|RoutineManagerInterface $routine */
123123
if ('file' === $flow) {
124124
$contentType = $configuration->getContentType();
125125
if ('unknown' === $contentType || 'csv' === $contentType) {
@@ -250,7 +250,7 @@ public function start(Request $request): JsonResponse
250250
throw new ImporterErrorException(sprintf('Not a supported flow: "%s"', $flow));
251251
}
252252

253-
/** @var RoutineManagerInterface $routine */
253+
/** @var null|RoutineManagerInterface $routine */
254254
if ('file' === $flow) {
255255
$contentType = $configuration->getContentType();
256256
if ('unknown' === $contentType || 'csv' === $contentType) {

app/Http/Controllers/Import/File/RoleController.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,10 @@ private function camtIndex(Request $request, Configuration $configuration): View
212212
private function getFieldsForLevel(string $level): array
213213
{
214214
$allFields = config('camt.fields');
215-
$return = [];
216-
foreach ($allFields as $title => $field) {
217-
if ($level === $field['level']) {
218-
$return[$title] = $field;
219-
}
220-
}
221215

222-
return $return;
216+
return array_filter($allFields, function ($field) use ($level) {
217+
return $level === $field['level'];
218+
});
223219
}
224220

225221
public function postIndex(RolesPostRequest $request): RedirectResponse

0 commit comments

Comments
 (0)