Browse Source

🤖 Auto commit for release 'develop' on 2025-06-26

pull/845/head
JC5 4 months ago
parent
commit
cea0f793f7
No known key found for this signature in database GPG Key ID: 910CF2B5E8B6CC6E
  1. 5
      app/Console/AutoImports.php
  2. 10
      app/Console/Commands/UpgradeImportConfigurations.php
  3. 6
      app/Console/Kernel.php
  4. 3
      app/Console/VerifyJSON.php
  5. 4
      app/Exceptions/AgreementExpiredException.php
  6. 4
      app/Exceptions/ApiException.php
  7. 4
      app/Exceptions/ApiHttpException.php
  8. 8
      app/Exceptions/Handler.php
  9. 4
      app/Exceptions/ImportException.php
  10. 4
      app/Exceptions/ImporterErrorException.php
  11. 4
      app/Exceptions/ImporterHttpException.php
  12. 4
      app/Exceptions/RateLimitException.php
  13. 4
      app/Exceptions/SpectreErrorException.php
  14. 4
      app/Exceptions/SpectreHttpException.php
  15. 7
      app/Http/Controllers/DebugController.php
  16. 2
      app/Http/Controllers/Import/AuthenticateController.php
  17. 10
      app/Http/Controllers/Import/ConfigurationController.php
  18. 27
      app/Http/Controllers/Import/ConversionController.php
  19. 5
      app/Http/Controllers/Import/DownloadController.php
  20. 3
      app/Http/Controllers/Import/DuplicateCheckController.php
  21. 22
      app/Http/Controllers/Import/MapController.php
  22. 3
      app/Http/Controllers/Import/Nordigen/SelectionController.php
  23. 5
      app/Http/Controllers/Import/Spectre/ConnectionController.php
  24. 6
      app/Http/Controllers/Import/SubmitController.php
  25. 23
      app/Http/Controllers/Import/UploadController.php
  26. 11
      app/Http/Controllers/TokenController.php
  27. 3
      app/Http/Middleware/Authenticate.php
  28. 3
      app/Http/Middleware/IsReadyForStep.php
  29. 3
      app/Http/Middleware/RedirectIfAuthenticated.php
  30. 3
      app/Http/Request/Request.php
  31. 18
      app/Jobs/ProcessImportSubmissionJob.php
  32. 5
      app/Providers/AppServiceProvider.php
  33. 3
      app/Rules/Iban.php
  34. 3
      app/Services/CSV/Configuration/ConfigFileProcessor.php
  35. 9
      app/Services/CSV/Conversion/Routine/CSVFileProcessor.php
  36. 6
      app/Services/CSV/Conversion/Routine/ColumnValueConverter.php
  37. 3
      app/Services/CSV/Conversion/RoutineManager.php
  38. 4
      app/Services/CSV/Converter/Amount.php
  39. 3
      app/Services/CSV/Converter/ConverterService.php
  40. 6
      app/Services/CSV/Converter/Date.php
  41. 3
      app/Services/CSV/Converter/Iban.php
  42. 2
      app/Services/CSV/Mapper/ExpenseRevenueAccounts.php
  43. 2
      app/Services/CSV/Mapper/MapperService.php
  44. 9
      app/Services/CSV/Roles/RoleService.php
  45. 3
      app/Services/Camt/Conversion/RoutineManager.php
  46. 4
      app/Services/Camt/Conversion/TransactionMapper.php
  47. 2
      app/Services/Camt/Transaction.php
  48. 6
      app/Services/Enums/AuthenticationStatus.php
  49. 4
      app/Services/Nordigen/Conversion/Routine/TransactionProcessor.php
  50. 3
      app/Services/Nordigen/Conversion/RoutineManager.php
  51. 17
      app/Services/Nordigen/Model/Transaction.php
  52. 4
      app/Services/Nordigen/Request/PostNewTokenRequest.php
  53. 5
      app/Services/Nordigen/Request/Request.php
  54. 4
      app/Services/Nordigen/Response/ArrayResponse.php
  55. 2
      app/Services/Nordigen/Response/GetTransactionsResponse.php
  56. 2
      app/Services/Nordigen/Response/ListAccountsResponse.php
  57. 2
      app/Services/Nordigen/Response/ListBanksResponse.php
  58. 6
      app/Services/Shared/Configuration/Configuration.php
  59. 6
      app/Services/Shared/Conversion/GeneratesIdentifier.php
  60. 28
      app/Services/Shared/Conversion/RoutineStatusManager.php
  61. 5
      app/Services/Shared/File/FileContentSherlock.php
  62. 28
      app/Services/Shared/Import/Status/SubmissionStatusManager.php
  63. 6
      app/Services/Shared/Submission/GeneratesIdentifier.php
  64. 19
      app/Services/SimpleFIN/Conversion/AccountMapper.php
  65. 7
      app/Services/SimpleFIN/Conversion/RoutineManager.php
  66. 9
      app/Services/SimpleFIN/Conversion/TransactionTransformer.php
  67. 11
      app/Services/SimpleFIN/Model/Account.php
  68. 13
      app/Services/SimpleFIN/Model/Transaction.php
  69. 15
      app/Services/SimpleFIN/SimpleFINService.php
  70. 6
      app/Services/SimpleFIN/Validation/ConfigurationContractValidator.php
  71. 4
      app/Services/Spectre/Conversion/Routine/TransactionProcessor.php
  72. 3
      app/Services/Spectre/Conversion/RoutineManager.php
  73. 59
      app/Services/Spectre/Model/TransactionExtra.php
  74. 29
      app/Services/Spectre/Request/Request.php
  75. 2
      app/Services/Spectre/Response/GetAccountsResponse.php
  76. 2
      app/Services/Spectre/Response/GetTransactionsResponse.php
  77. 2
      app/Services/Spectre/Response/ListConnectionsResponse.php
  78. 2
      app/Services/Spectre/Response/ListCustomersResponse.php
  79. 4
      app/Services/Spectre/Response/PutRefreshConnectionResponse.php
  80. 13
      app/Services/Storage/StorageService.php
  81. 3
      app/Support/Internal/CollectsAccounts.php
  82. 3
      app/User.php
  83. 13
      composer.lock
  84. 2
      config/ide-helper.php
  85. 2
      config/importer.php
  86. 166
      package-lock.json
  87. 2
      routes/api.php
  88. 2
      routes/channels.php

5
app/Console/AutoImports.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Console;
use JsonException;
use App\Enums\ExitCode;
use App\Events\ImportedTransactions;
use App\Exceptions\ImporterErrorException;
@ -379,7 +378,7 @@ trait AutoImports
try {
$disk->put(sprintf('%s.json', $this->identifier), json_encode($transactions, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
} catch (JsonException $e) {
} catch (\JsonException $e) {
Log::error(sprintf('JSON exception: %s', $e->getMessage()));
RoutineStatusManager::setConversionStatus(ConversionStatus::CONVERSION_ERRORED, $this->identifier);
$this->conversionMessages = $manager->getAllMessages();
@ -455,7 +454,7 @@ trait AutoImports
$json = $disk->get($fileName);
$transactions = json_decode((string) $json, true, 512, JSON_THROW_ON_ERROR);
Log::debug(sprintf('Found %d transactions on the drive.', count($transactions)));
} catch (FileNotFoundException|JsonException $e) {
} catch (FileNotFoundException|\JsonException $e) {
SubmissionStatusManager::setSubmissionStatus(SubmissionStatus::SUBMISSION_ERRORED, $this->identifier);
$message = sprintf('[a101]: File "%s" could not be decoded, cannot continue..', $fileName);
$this->error($message);

10
app/Console/Commands/UpgradeImportConfigurations.php

@ -25,10 +25,6 @@ declare(strict_types=1);
namespace App\Console\Commands;
use RecursiveDirectoryIterator;
use FilesystemIterator;
use RecursiveIteratorIterator;
use SplFileInfo;
use App\Services\Shared\Configuration\Configuration;
use Illuminate\Console\Command;
@ -70,12 +66,12 @@ final class UpgradeImportConfigurations extends Command
private function processRoot(string $directory): void
{
$dir = new RecursiveDirectoryIterator($directory, FilesystemIterator::SKIP_DOTS);
$files = new RecursiveIteratorIterator($dir, RecursiveIteratorIterator::SELF_FIRST);
$dir = new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS);
$files = new \RecursiveIteratorIterator($dir, \RecursiveIteratorIterator::SELF_FIRST);
/**
* @var string $name
* @var SplFileInfo $object
* @var \SplFileInfo $object
*/
foreach ($files as $name => $object) {
$this->processFile($name);

6
app/Console/Kernel.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Console;
use Override;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
@ -46,7 +45,7 @@ class Kernel extends ConsoleKernel
/**
* Register the commands for the application.
*/
#[Override]
#[\Override]
protected function commands(): void
{
$accessToken = (string) env('FIREFLY_III_ACCESS_TOKEN', '');
@ -66,6 +65,7 @@ class Kernel extends ConsoleKernel
echo PHP_EOL;
echo 'If you set VANITY_URL you must also set FIREFLY_III_URL';
echo PHP_EOL;
exit;
}
@ -77,6 +77,6 @@ class Kernel extends ConsoleKernel
/**
* Define the application's command schedule.
*/
#[Override]
#[\Override]
protected function schedule(Schedule $schedule): void {}
}

3
app/Console/VerifyJSON.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Console;
use JsonException;
use Illuminate\Support\Facades\Log;
/**
@ -40,7 +39,7 @@ trait VerifyJSON
try {
json_decode($json, true, 512, JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
} catch (\JsonException $e) {
$message = sprintf('The importer can\'t import: could not decode the JSON in the config file: %s', $e->getMessage());
Log::error($message);

4
app/Exceptions/AgreementExpiredException.php

@ -25,12 +25,10 @@ declare(strict_types=1);
namespace App\Exceptions;
use Exception;
/**
* Class AgreementExpiredException
*/
class AgreementExpiredException extends Exception
class AgreementExpiredException extends \Exception
{
public array $json = [];
}

4
app/Exceptions/ApiException.php

@ -25,11 +25,9 @@ declare(strict_types=1);
namespace App\Exceptions;
use Exception;
/**
* Class ApiException
*
* @deprecated
*/
class ApiException extends Exception {}
class ApiException extends \Exception {}

4
app/Exceptions/ApiHttpException.php

@ -25,11 +25,9 @@ declare(strict_types=1);
namespace App\Exceptions;
use Exception;
/**
* Class ApiHttpException
*
* @deprecated
*/
class ApiHttpException extends Exception {}
class ApiHttpException extends \Exception {}

8
app/Exceptions/Handler.php

@ -25,8 +25,6 @@ declare(strict_types=1);
namespace App\Exceptions;
use Override;
use Throwable;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@ -52,10 +50,10 @@ class Handler extends ExceptionHandler
*
* @return \Illuminate\Http\Response|JsonResponse|Response
*
* @throws Throwable
* @throws \Throwable
*/
#[Override]
public function render($request, Throwable $e)
#[\Override]
public function render($request, \Throwable $e)
{
if ($e instanceof ImporterErrorException || $e instanceof ImporterHttpException) {
$isDebug = config('app.debug');

4
app/Exceptions/ImportException.php

@ -25,11 +25,9 @@ declare(strict_types=1);
namespace App\Exceptions;
use Exception;
/**
* Class ImportException
*
* @deprecated
*/
class ImportException extends Exception {}
class ImportException extends \Exception {}

4
app/Exceptions/ImporterErrorException.php

@ -25,12 +25,10 @@ declare(strict_types=1);
namespace App\Exceptions;
use Exception;
/**
* Class ImporterErrorException
*/
class ImporterErrorException extends Exception
class ImporterErrorException extends \Exception
{
public array $json;
public int $statusCode = 0;

4
app/Exceptions/ImporterHttpException.php

@ -25,9 +25,7 @@ declare(strict_types=1);
namespace App\Exceptions;
use Exception;
/**
* Class ImporterHttpException
*/
class ImporterHttpException extends Exception {}
class ImporterHttpException extends \Exception {}

4
app/Exceptions/RateLimitException.php

@ -25,6 +25,4 @@ declare(strict_types=1);
namespace App\Exceptions;
use Exception;
class RateLimitException extends Exception {}
class RateLimitException extends \Exception {}

4
app/Exceptions/SpectreErrorException.php

@ -25,14 +25,12 @@ declare(strict_types=1);
namespace App\Exceptions;
use Exception;
/**
* Class SpectreErrorException
*
* @deprecated
*/
class SpectreErrorException extends Exception
class SpectreErrorException extends \Exception
{
public array $json;
}

4
app/Exceptions/SpectreHttpException.php

@ -25,11 +25,9 @@ declare(strict_types=1);
namespace App\Exceptions;
use Exception;
/**
* Class SpectreHttpException
*
* @deprecated
*/
class SpectreHttpException extends Exception {}
class SpectreHttpException extends \Exception {}

7
app/Http/Controllers/DebugController.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Http\Controllers;
use Exception;
use Carbon\Carbon;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\Request;
@ -56,7 +55,7 @@ class DebugController extends Controller
if (null !== $logFile) {
try {
$logContent = (string)file_get_contents($logFile);
} catch (Exception) {
} catch (\Exception) {
// @ignoreException
}
}
@ -64,7 +63,7 @@ class DebugController extends Controller
}
if ('' !== $logContent) {
// last few lines
$logContent = sprintf('Truncated from this point <----|%s',substr($logContent, -32 * 1024));
$logContent = sprintf('Truncated from this point <----|%s', substr($logContent, -32 * 1024));
}
if (true === config('importer.is_external')) {
$logContent = 'No logs, external installation.';
@ -110,7 +109,7 @@ class DebugController extends Controller
if (file_exists('/var/www/counter-main.txt')) {
$build = trim((string) file_get_contents('/var/www/counter-main.txt'));
}
} catch (Exception $e) {
} catch (\Exception $e) {
Log::debug('Could not check build counter, but that\'s ok.');
Log::warning($e->getMessage());
}

2
app/Http/Controllers/Import/AuthenticateController.php

@ -69,7 +69,7 @@ class AuthenticateController extends Controller
$pageTitle = 'Authentication';
$flow = $request->cookie(Constants::FLOW_COOKIE);
$subTitle = ucfirst($flow);
$error = Session::get('error');
$error = \Session::get('error');
if ('spectre' === $flow) {
$validator = new SpectreValidator();

10
app/Http/Controllers/Import/ConfigurationController.php

@ -25,8 +25,6 @@ declare(strict_types=1);
namespace App\Http\Controllers\Import;
use Exception;
use JsonException;
use App\Exceptions\AgreementExpiredException;
use App\Exceptions\ImporterErrorException;
use App\Http\Controllers\Controller;
@ -171,7 +169,7 @@ class ConfigurationController extends Controller
if (!array_key_exists('name', $account) || null === $account['name']) {
Log::warning('SimpleFIN account data is missing name field, adding default.', ['account_id' => $account['id']]);
$account['name'] = sprintf('Unknown Account (ID: %s)',$account['id']);
$account['name'] = sprintf('Unknown Account (ID: %s)', $account['id']);
}
if (!array_key_exists('currency', $account) || null === $account['currency']) {
@ -285,8 +283,8 @@ class ConfigurationController extends Controller
$mapper = app(TransactionCurrencies::class);
return $mapper->getMap();
} catch (Exception $e) {
Log::error(sprintf('Failed to load currencies: %s',$e->getMessage()));
} catch (\Exception $e) {
Log::error(sprintf('Failed to load currencies: %s', $e->getMessage()));
return [];
}
@ -374,7 +372,7 @@ class ConfigurationController extends Controller
try {
$json = json_encode($configuration->toArray(), JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT);
} catch (JsonException $e) {
} catch (\JsonException $e) {
Log::error($e->getMessage());
throw new ImporterErrorException($e->getMessage(), 0, $e);

27
app/Http/Controllers/Import/ConversionController.php

@ -25,9 +25,6 @@ declare(strict_types=1);
namespace App\Http\Controllers\Import;
use Throwable;
use Storage;
use JsonException;
use App\Exceptions\ImporterErrorException;
use App\Http\Controllers\Controller;
use App\Http\Middleware\ConversionControllerMiddleware;
@ -143,11 +140,11 @@ class ConversionController extends Controller
try {
$routine = new SimpleFINRoutineManager($identifier);
Log::debug('SimpleFIN routine manager created successfully.');
} catch (Throwable $e) {
Log::error(sprintf('Failed to create SimpleFIN routine manager: %s',$e->getMessage()));
Log::error(sprintf('Error class: %s',$e::class));
Log::error(sprintf('Error file: %s:%d',$e->getFile(),$e->getLine()));
Log::error(sprintf('Stack trace: %s',$e->getTraceAsString()));
} catch (\Throwable $e) {
Log::error(sprintf('Failed to create SimpleFIN routine manager: %s', $e->getMessage()));
Log::error(sprintf('Error class: %s', $e::class));
Log::error(sprintf('Error file: %s:%d', $e->getFile(), $e->getLine()));
Log::error(sprintf('Stack trace: %s', $e->getTraceAsString()));
throw $e;
}
@ -267,11 +264,11 @@ class ConversionController extends Controller
try {
$routine = new SimpleFINRoutineManager($identifier);
Log::debug('SimpleFIN routine manager created successfully in start method.');
} catch (Throwable $e) {
Log::error(sprintf('Failed to create SimpleFIN routine manager in start method: %s',$e->getMessage()));
Log::error(sprintf('Error class: %s',$e::class));
Log::error(sprintf('Error file: %s:%d',$e->getFile(),$e->getLine()));
Log::error(sprintf('Stack trace: %s',$e->getTraceAsString()));
} catch (\Throwable $e) {
Log::error(sprintf('Failed to create SimpleFIN routine manager in start method: %s', $e->getMessage()));
Log::error(sprintf('Error class: %s', $e::class));
Log::error(sprintf('Error file: %s:%d', $e->getFile(), $e->getLine()));
Log::error(sprintf('Stack trace: %s', $e->getTraceAsString()));
throw $e;
}
@ -306,11 +303,11 @@ class ConversionController extends Controller
}
Log::debug(sprintf('Conversion routine "%s" yielded %d transaction(s).', $flow, count($transactions)));
// save transactions in 'jobs' directory under the same key as the conversion thing.
$disk = Storage::disk(self::DISK_NAME);
$disk = \Storage::disk(self::DISK_NAME);
try {
$disk->put(sprintf('%s.json', $identifier), json_encode($transactions, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
} catch (JsonException $e) {
} catch (\JsonException $e) {
Log::error(sprintf('JSON exception: %s', $e->getMessage()));
Log::error($e->getTraceAsString());
RoutineStatusManager::setConversionStatus(ConversionStatus::CONVERSION_ERRORED);

5
app/Http/Controllers/Import/DownloadController.php

@ -26,7 +26,6 @@ declare(strict_types=1);
namespace App\Http\Controllers\Import;
use Carbon\Carbon;
use JsonException;
use App\Http\Controllers\Controller;
use App\Support\Http\RestoresConfiguration;
use Illuminate\Contracts\Foundation\Application;
@ -41,7 +40,7 @@ class DownloadController extends Controller
use RestoresConfiguration;
/**
* @throws JsonException
* @throws \JsonException
*/
public function download(): Application|Response|ResponseFactory
{
@ -51,7 +50,7 @@ class DownloadController extends Controller
$result = json_encode($array, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR);
$response = response($result);
$name = sprintf('import_config_%s.json', Carbon::now()->format('Y-m-d'));
$response->header('Content-disposition', sprintf('attachment; filename=%s',$name))
$response->header('Content-disposition', sprintf('attachment; filename=%s', $name))
->header('Content-Type', 'application/json')
->header('Content-Description', 'File Transfer')
->header('Connection', 'Keep-Alive')

3
app/Http/Controllers/Import/DuplicateCheckController.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Http\Controllers\Import;
use Exception;
use App\Http\Controllers\Controller;
use App\Http\Middleware\ConfigurationControllerMiddleware;
use App\Services\SimpleFIN\Validation\ConfigurationContractValidator;
@ -109,7 +108,7 @@ class DuplicateCheckController extends Controller
'message' => $message,
]);
} catch (Exception $e) {
} catch (\Exception $e) {
Log::error('DUPLICATE_CHECK: Exception during duplicate check', [
'error' => $e->getMessage(),
'trace' => $e->getTraceAsString(),

22
app/Http/Controllers/Import/MapController.php

@ -25,9 +25,7 @@ declare(strict_types=1);
namespace App\Http\Controllers\Import;
use InvalidArgumentException;
use App\Services\CSV\Mapper\ExpenseRevenueAccounts;
use JsonException;
use App\Exceptions\ImporterErrorException;
use App\Http\Controllers\Controller;
use App\Http\Middleware\MapControllerMiddleware;
@ -146,7 +144,7 @@ class MapController extends Controller
// create the "mapper" class which will get data from Firefly III.
$class = sprintf('App\Services\CSV\Mapper\%s', $info['mapper']);
if (!class_exists($class)) {
throw new InvalidArgumentException(sprintf('Class %s does not exist.', $class));
throw new \InvalidArgumentException(sprintf('Class %s does not exist.', $class));
}
Log::debug(sprintf('Associated class is %s', $class));
@ -222,7 +220,7 @@ class MapController extends Controller
// create the "mapper" class which will get data from Firefly III.
$class = sprintf('App\Services\CSV\Mapper\%s', $info['mapper']);
if (!class_exists($class)) {
throw new InvalidArgumentException(sprintf('Class %s does not exist.', $class));
throw new \InvalidArgumentException(sprintf('Class %s does not exist.', $class));
}
Log::debug(sprintf('Associated class is %s', $class));
@ -266,7 +264,7 @@ class MapController extends Controller
// create the "mapper" class which will get data from Firefly III.
$class = sprintf('App\Services\CSV\Mapper\%s', $opposingName['mapper']);
if (!class_exists($class)) {
throw new InvalidArgumentException(sprintf('Class %s does not exist.', $class));
throw new \InvalidArgumentException(sprintf('Class %s does not exist.', $class));
}
Log::debug(sprintf('Associated class is %s', $class));
@ -287,7 +285,7 @@ class MapController extends Controller
// create the "mapper" class which will get data from Firefly III.
$class = sprintf('App\Services\CSV\Mapper\%s', $category['mapper']);
if (!class_exists($class)) {
throw new InvalidArgumentException(sprintf('Class %s does not exist.', $class));
throw new \InvalidArgumentException(sprintf('Class %s does not exist.', $class));
}
Log::debug(sprintf('Associated class is %s', $class));
@ -307,7 +305,7 @@ class MapController extends Controller
// Use ExpenseRevenueAccounts mapper for SimpleFIN
$class = ExpenseRevenueAccounts::class;
if (!class_exists($class)) {
throw new InvalidArgumentException(sprintf('Class %s does not exist.', $class));
throw new \InvalidArgumentException(sprintf('Class %s does not exist.', $class));
}
Log::debug(sprintf('Associated class is %s', $class));
@ -350,7 +348,7 @@ class MapController extends Controller
try {
$array = json_decode($json, true, 512, JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
} catch (\JsonException $e) {
throw new ImporterErrorException(sprintf('Could not decode download: %s', $e->getMessage()), 0, $e);
}
$opposing = [];
@ -368,7 +366,7 @@ class MapController extends Controller
}
$filtered = array_filter(
$opposing,
static fn(string $value) => '' !== $value
static fn (string $value) => '' !== $value
);
return array_unique($filtered);
@ -403,7 +401,7 @@ class MapController extends Controller
try {
$array = json_decode($json, true, 512, JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
} catch (\JsonException $e) {
throw new ImporterErrorException(sprintf('Could not decode download: %s', $e->getMessage()), 0, $e);
}
$expenseRevenue = [];
@ -448,7 +446,7 @@ class MapController extends Controller
try {
$array = json_decode((string) $json, true, 512, JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
} catch (\JsonException $e) {
throw new ImporterErrorException(sprintf('Could not decode download: %s', $e->getMessage()), 0, $e);
}
$categories = [];
@ -465,7 +463,7 @@ class MapController extends Controller
}
$filtered = array_filter(
$categories,
static fn(string $value) => '' !== $value
static fn (string $value) => '' !== $value
);
return array_unique($filtered);

3
app/Http/Controllers/Import/Nordigen/SelectionController.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Http\Controllers\Import\Nordigen;
use JsonException;
use App\Exceptions\AgreementExpiredException;
use App\Exceptions\ImporterErrorException;
use App\Exceptions\ImporterHttpException;
@ -128,7 +127,7 @@ class SelectionController extends Controller
try {
$json = json_encode($configuration->toArray(), JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
} catch (\JsonException $e) {
Log::error($e->getMessage());
}
StorageService::storeContent($json);

5
app/Http/Controllers/Import/Spectre/ConnectionController.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Http\Controllers\Import\Spectre;
use JsonException;
use App\Exceptions\ImporterErrorException;
use App\Http\Controllers\Controller;
use App\Http\Middleware\ConnectionControllerMiddleware;
@ -120,7 +119,7 @@ class ConnectionController extends Controller
try {
$json = json_encode($configuration->toArray(), JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
} catch (\JsonException $e) {
Log::error($e->getMessage());
}
StorageService::storeContent($json);
@ -175,7 +174,7 @@ class ConnectionController extends Controller
try {
$json = json_encode($configuration->toArray(), JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
} catch (\JsonException $e) {
Log::error($e->getMessage());
}
StorageService::storeContent($json);

6
app/Http/Controllers/Import/SubmitController.php

@ -25,8 +25,6 @@ declare(strict_types=1);
namespace App\Http\Controllers\Import;
use Storage;
use JsonException;
use App\Exceptions\ImporterErrorException;
use App\Http\Controllers\Controller;
use App\Http\Middleware\SubmitControllerMiddleware;
@ -116,7 +114,7 @@ class SubmitController extends Controller
// search for transactions on disk using the import routine's identifier, NOT the submission routine's:
$conversionIdentifier = session()->get(Constants::CONVERSION_JOB_IDENTIFIER);
$disk = Storage::disk(self::DISK_NAME);
$disk = \Storage::disk(self::DISK_NAME);
$fileName = sprintf('%s.json', $conversionIdentifier);
// get files from disk:
@ -132,7 +130,7 @@ class SubmitController extends Controller
$json = $disk->get($fileName);
$transactions = json_decode((string) $json, true, 512, JSON_THROW_ON_ERROR);
Log::debug(sprintf('Found %d transactions on the drive.', count($transactions)));
} catch (FileNotFoundException|JsonException $e) {
} catch (FileNotFoundException|\JsonException $e) {
Log::error(sprintf('The file "%s" on "%s" disk contains error: %s', $fileName, self::DISK_NAME, $e->getMessage()));
// TODO error in logs
SubmissionStatusManager::setSubmissionStatus(SubmissionStatus::SUBMISSION_ERRORED);

23
app/Http/Controllers/Import/UploadController.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Http\Controllers\Import;
use Storage;
use App\Exceptions\ImporterErrorException;
use App\Http\Controllers\Controller;
use App\Http\Middleware\UploadControllerMiddleware;
@ -72,22 +71,22 @@ class UploadController extends Controller
public function index(Request $request)
{
Log::debug(sprintf('Now at %s', __METHOD__));
$mainTitle = 'Upload your file(s)';
$subTitle = 'Start page and instructions';
$flow = $request->cookie(Constants::FLOW_COOKIE);
$mainTitle = 'Upload your file(s)';
$subTitle = 'Start page and instructions';
$flow = $request->cookie(Constants::FLOW_COOKIE);
// simplefin settings.
$simpleFinToken = config('simplefin.token');
$simpleFinToken = config('simplefin.token');
$simpleFinOriginUrl = config('simplefin.origin_url');
// get existing configs.
$disk = Storage::disk('configurations');
$disk = \Storage::disk('configurations');
Log::debug(sprintf('Going to check directory for config files: %s', config('filesystems.disks.configurations.root')));
$all = $disk->files();
$all = $disk->files();
// remove files from list
$list = [];
$ignored = config('importer.ignored_files');
$list = [];
$ignored = config('importer.ignored_files');
foreach ($all as $entry) {
if (!in_array($entry, $ignored, true)) {
$list[] = $entry;
@ -96,7 +95,7 @@ class UploadController extends Controller
Log::debug('List of files:', $list);
return view('import.003-upload.index', compact('mainTitle', 'subTitle', 'list', 'flow','simpleFinOriginUrl','simpleFinToken'));
return view('import.003-upload.index', compact('mainTitle', 'subTitle', 'list', 'flow', 'simpleFinOriginUrl', 'simpleFinToken'));
}
/**
@ -276,7 +275,7 @@ class UploadController extends Controller
{
if (!$file instanceof UploadedFile && '' !== $selection) {
Log::debug('User selected a config file from the store.');
$disk = Storage::disk('configurations');
$disk = \Storage::disk('configurations');
$configFileName = StorageService::storeContent($disk->get($selection));
session()->put(Constants::UPLOAD_CONFIG_FILE, $configFileName);
@ -350,7 +349,7 @@ class UploadController extends Controller
return redirect(route('004-configure.index'));
} catch (ImporterErrorException $e) {
Log::error('SimpleFIN connection failed', ['error' => $e->getMessage()]);
$errors->add('connection', sprintf('Failed to connect to SimpleFIN: %s',$e->getMessage()));
$errors->add('connection', sprintf('Failed to connect to SimpleFIN: %s', $e->getMessage()));
return redirect(route('003-upload.index'))->withErrors($errors);
}

11
app/Http/Controllers/TokenController.php

@ -25,9 +25,6 @@ declare(strict_types=1);
namespace App\Http\Controllers;
use JsonException;
use Str;
use Throwable;
use App\Exceptions\ImporterErrorException;
use App\Services\Session\Constants;
use App\Services\Shared\Authentication\SecretManager;
@ -59,7 +56,7 @@ class TokenController extends Controller
*
* @throws ImporterErrorException
* @throws GuzzleException
* @throws Throwable
* @throws \Throwable
*/
public function callback(Request $request)
{
@ -116,7 +113,7 @@ class TokenController extends Controller
try {
$data = json_decode((string)$response->getBody(), true, 512, JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
} catch (\JsonException $e) {
Log::error(sprintf('JSON exception when decoding response: %s', $e->getMessage()));
Log::error(sprintf('Response from server: "%s"', (string)$response->getBody()));
@ -272,8 +269,8 @@ class TokenController extends Controller
$vanityURL = rtrim($vanityURL, '/');
Log::debug(sprintf('Now in %s(request, "%s", "%s", %d)', __METHOD__, $baseURL, $vanityURL, $clientId));
$state = Str::random(40);
$codeVerifier = Str::random(128);
$state = \Str::random(40);
$codeVerifier = \Str::random(128);
$request->session()->put('state', $state);
$request->session()->put('code_verifier', $codeVerifier);
$request->session()->put('form_client_id', $clientId);

3
app/Http/Middleware/Authenticate.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Http\Middleware;
use Override;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
use Illuminate\Http\Request;
@ -39,7 +38,7 @@ class Authenticate extends Middleware
*
* @param Request $request
*/
#[Override]
#[\Override]
protected function redirectTo($request): ?string
{
if (!$request->expectsJson()) {

3
app/Http/Middleware/IsReadyForStep.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Http\Middleware;
use Closure;
use App\Exceptions\ImporterErrorException;
use App\Services\Session\Constants;
use Illuminate\Http\RedirectResponse;
@ -39,7 +38,7 @@ trait IsReadyForStep
{
public const string TEST = 'test';
public function handle(Request $request, Closure $next): mixed
public function handle(Request $request, \Closure $next): mixed
{
$result = $this->isReadyForStep($request);
if (true === $result) {

3
app/Http/Middleware/RedirectIfAuthenticated.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Http\Middleware;
use Closure;
use App\Providers\RouteServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
@ -43,7 +42,7 @@ class RedirectIfAuthenticated
*
* @return mixed
*/
public function handle($request, Closure $next, $guard = null)
public function handle($request, \Closure $next, $guard = null)
{
if (Auth::guard($guard)->check()) {
return redirect(RouteServiceProvider::HOME);

3
app/Http/Request/Request.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Http\Request;
use Exception;
use Carbon\Carbon;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
@ -131,7 +130,7 @@ class Request extends FormRequest
try {
$result = $this->get($field) ? new Carbon($this->get($field)) : null;
} catch (Exception $e) {
} catch (\Exception $e) {
Log::debug(sprintf('Exception when parsing date. Not interesting: %s', $e->getMessage()));
}

18
app/Jobs/ProcessImportSubmissionJob.php

@ -4,8 +4,6 @@ declare(strict_types=1);
namespace App\Jobs;
use Exception;
use Throwable;
use App\Services\Shared\Configuration\Configuration;
use App\Services\Shared\Import\Routine\RoutineManager;
use App\Services\Shared\Import\Status\SubmissionStatus;
@ -41,9 +39,7 @@ class ProcessImportSubmissionJob implements ShouldQueue
/**
* Create a new job instance.
*/
public function __construct(private string $identifier, private Configuration $configuration, private array $transactions, private string $accessToken, private string $baseUrl, private ?string $vanityUrl)
{
}
public function __construct(private string $identifier, private Configuration $configuration, private array $transactions, private string $accessToken, private string $baseUrl, private ?string $vanityUrl) {}
/**
* Execute the job.
@ -57,11 +53,11 @@ class ProcessImportSubmissionJob implements ShouldQueue
// Validate authentication credentials before proceeding
if ('' === $this->accessToken) {
throw new Exception('Access token is empty - cannot authenticate with Firefly III');
throw new \Exception('Access token is empty - cannot authenticate with Firefly III');
}
if ('' === $this->baseUrl) {
throw new Exception('Base URL is empty - cannot connect to Firefly III');
throw new \Exception('Base URL is empty - cannot connect to Firefly III');
}
Log::info('Job authentication credentials validation', [
@ -116,13 +112,13 @@ class ProcessImportSubmissionJob implements ShouldQueue
]);
if ($verifyToken !== $this->accessToken) {
throw new Exception(
throw new \Exception(
'Failed to set access token in config properly'
);
}
if ($verifyUrl !== $this->baseUrl) {
throw new Exception(
throw new \Exception(
'Failed to set base URL in config properly'
);
}
@ -157,7 +153,7 @@ class ProcessImportSubmissionJob implements ShouldQueue
'warnings' => count($routine->getAllWarnings()),
'errors' => count($routine->getAllErrors()),
]);
} catch (Throwable $e) {
} catch (\Throwable $e) {
Log::error('ProcessImportSubmissionJob failed', [
'identifier' => $this->identifier,
'error' => $e->getMessage(),
@ -185,7 +181,7 @@ class ProcessImportSubmissionJob implements ShouldQueue
/**
* Handle a job failure.
*/
public function failed(Throwable $exception): void
public function failed(\Throwable $exception): void
{
Log::error('ProcessImportSubmissionJob marked as failed', [
'identifier' => $this->identifier,

5
app/Providers/AppServiceProvider.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Providers;
use Override;
use App\Support\Steam;
use Illuminate\Support\ServiceProvider;
@ -42,12 +41,12 @@ class AppServiceProvider extends ServiceProvider
/**
* Register any application services.
*/
#[Override]
#[\Override]
public function register(): void
{
$this->app->bind(
'steam',
static fn() => new Steam()
static fn () => new Steam()
);
}
}

3
app/Rules/Iban.php

@ -24,7 +24,6 @@ declare(strict_types=1);
namespace App\Rules;
use Closure;
use App\Services\CSV\Converter\Iban as IbanConverter;
use Illuminate\Contracts\Validation\ValidationRule;
@ -44,7 +43,7 @@ class Iban implements ValidationRule
/**
* Determine if the given value is a valid IBAN.
*/
public function validate(string $attribute, mixed $value, Closure $fail): void
public function validate(string $attribute, mixed $value, \Closure $fail): void
{
$result = IbanConverter::isValidIban((string)$value);
if (!$result) {

3
app/Services/CSV/Configuration/ConfigFileProcessor.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Services\CSV\Configuration;
use JsonException;
use App\Exceptions\ImporterErrorException;
use App\Services\Shared\Configuration\Configuration;
use App\Services\Storage\StorageService;
@ -56,7 +55,7 @@ class ConfigFileProcessor
try {
$json = json_decode($content, true, 512, JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
} catch (\JsonException $e) {
Log::error($e->getMessage());
throw new ImporterErrorException(sprintf('Invalid JSON configuration file: %s', $e->getMessage()));

9
app/Services/CSV/Conversion/Routine/CSVFileProcessor.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Services\CSV\Conversion\Routine;
use JsonException;
use App\Exceptions\ImporterErrorException;
use App\Services\Shared\Configuration\Configuration;
use App\Services\Shared\Conversion\ProgressInformation;
@ -48,9 +47,7 @@ class CSVFileProcessor
/**
* CSVFileProcessor constructor.
*/
public function __construct(private Configuration $configuration)
{
}
public function __construct(private Configuration $configuration) {}
/**
* Get a reader, and start looping over each line.
@ -144,7 +141,7 @@ class CSVFileProcessor
$lineValues = array_values($line);
array_walk(
$lineValues,
static fn($element) => trim(str_replace('&nbsp;', ' ', (string) $element))
static fn ($element) => trim(str_replace('&nbsp;', ' ', (string) $element))
);
return $lineValues;
@ -160,7 +157,7 @@ class CSVFileProcessor
foreach ($array as $index => $line) {
try {
$hash = hash('sha256', json_encode($line, JSON_THROW_ON_ERROR));
} catch (JsonException $e) {
} catch (\JsonException $e) {
Log::error($e->getMessage());
// Log::error($e->getTraceAsString());

6
app/Services/CSV/Conversion/Routine/ColumnValueConverter.php

@ -25,8 +25,6 @@ declare(strict_types=1);
namespace App\Services\CSV\Conversion\Routine;
use UnexpectedValueException;
use JsonException;
use App\Exceptions\ImporterErrorException;
use App\Services\Shared\Configuration\Configuration;
use App\Services\Shared\Conversion\ProgressInformation;
@ -115,7 +113,7 @@ class ColumnValueConverter
$transactionField = $this->roleToTransaction[$role] ?? null;
$parsedValue = $value->getParsedValue();
if (null === $transactionField) {
throw new UnexpectedValueException(sprintf('No place for role "%s"', $value->getRole()));
throw new \UnexpectedValueException(sprintf('No place for role "%s"', $value->getRole()));
}
if (null === $parsedValue) {
Log::debug(sprintf('Skip column #%d with role "%s" (in field "%s")', $columnIndex + 1, $role, $transactionField));
@ -189,7 +187,7 @@ class ColumnValueConverter
if (is_array($value)) {
try {
return json_encode($value, JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
} catch (\JsonException $e) {
throw new ImporterErrorException($e->getMessage(), 0, $e);
}
}

3
app/Services/CSV/Conversion/RoutineManager.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Services\CSV\Conversion;
use Override;
use App\Exceptions\ImporterErrorException;
use App\Services\CSV\Conversion\Routine\ColumnValueConverter;
use App\Services\CSV\Conversion\Routine\CSVFileProcessor;
@ -76,7 +75,7 @@ class RoutineManager implements RoutineManagerInterface
}
}
#[Override]
#[\Override]
public function getServiceAccounts(): array
{
return [];

4
app/Services/CSV/Converter/Amount.php

@ -150,7 +150,7 @@ class Amount implements ConverterInterface
Log::debug(sprintf('No decimal character found. Converted amount from "%s" to "%s".', $original, $value));
}
if (str_starts_with($value, '.')) {
$value = sprintf('0%s',$value);
$value = sprintf('0%s', $value);
}
if (is_numeric($value)) {
@ -182,7 +182,7 @@ class Amount implements ConverterInterface
$str = preg_replace('/[^\-().,0-9 ]/', '', $value);
$len = strlen((string) $str);
if (str_starts_with((string) $str, '(') && ')' === $str[$len - 1]) {
$str = sprintf('-%s',substr((string) $str, 1, $len - 2));
$str = sprintf('-%s', substr((string) $str, 1, $len - 2));
}
$str = trim((string) $str);

3
app/Services/CSV/Converter/ConverterService.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Services\CSV\Converter;
use UnexpectedValueException;
use Illuminate\Support\Facades\Log;
/**
@ -52,7 +51,7 @@ class ConverterService
return $object->convert($value);
}
throw new UnexpectedValueException(sprintf('No such converter: "%s"', $class));
throw new \UnexpectedValueException(sprintf('No such converter: "%s"', $class));
}
public static function exists(string $class): bool

6
app/Services/CSV/Converter/Date.php

@ -25,8 +25,6 @@ declare(strict_types=1);
namespace App\Services\CSV\Converter;
use Exception;
use InvalidArgumentException;
use Carbon\Carbon;
use Carbon\Language;
use Illuminate\Support\Facades\Log;
@ -76,7 +74,7 @@ class Date implements ConverterInterface
try {
$carbon = Carbon::createFromLocaleFormat($this->dateFormat, $this->dateLocale, $string);
} catch (Exception|InvalidArgumentException $e) {
} catch (\Exception|\InvalidArgumentException $e) {
Log::error(sprintf('%s converting the date: %s', $e::class, $e->getMessage()));
Log::debug('Date parsing error, will return today instead.');
@ -107,7 +105,7 @@ class Date implements ConverterInterface
$dateFormatConfiguration = [];
preg_match($this->dateFormatPattern, $format, $dateFormatConfiguration);
if (3 === count($dateFormatConfiguration)) {
$currentDateLocale = $dateFormatConfiguration[1] !== '' && $dateFormatConfiguration[1] !== '0' ? $dateFormatConfiguration[1] : $currentDateLocale;
$currentDateLocale = '' !== $dateFormatConfiguration[1] && '0' !== $dateFormatConfiguration[1] ? $dateFormatConfiguration[1] : $currentDateLocale;
$currentDateFormat = $dateFormatConfiguration[2];
}

3
app/Services/CSV/Converter/Iban.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Services\CSV\Converter;
use ValueError;
use Illuminate\Support\Facades\Log;
/**
@ -98,7 +97,7 @@ class Iban implements ConverterInterface
try {
$checksum = bcmod($iban, '97');
} catch (ValueError $e) {
} catch (\ValueError $e) {
Log::error(sprintf('Bad IBAN: %s', $e->getMessage()));
$checksum = 2;
}

2
app/Services/CSV/Mapper/ExpenseRevenueAccounts.php

@ -81,7 +81,7 @@ class ExpenseRevenueAccounts implements MapperInterface
$allAccounts = $this->toArray($response);
// Filter for expense and revenue accounts only
$expenseRevenueAccounts = array_filter($allAccounts, fn(Account $account) => in_array($account->type, ['expense', 'revenue'], true));
$expenseRevenueAccounts = array_filter($allAccounts, fn (Account $account) => in_array($account->type, ['expense', 'revenue'], true));
Log::debug(sprintf('getExpenseRevenueAccounts: Found %d expense/revenue accounts', count($expenseRevenueAccounts)));

2
app/Services/CSV/Mapper/MapperService.php

@ -181,7 +181,7 @@ class MapperService
foreach ($data as $title => $info) {
$filtered = array_filter(
$info['values'],
static fn(string $value) => '' !== $value
static fn (string $value) => '' !== $value
);
$info['values'] = array_unique($filtered);
sort($info['values']);

9
app/Services/CSV/Roles/RoleService.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Services\CSV\Roles;
use InvalidArgumentException;
use App\Services\Camt\Transaction;
use App\Services\Session\Constants;
use App\Services\Shared\Configuration\Configuration;
@ -87,7 +86,7 @@ class RoleService
} catch (Exception $e) {
Log::error($e->getMessage());
throw new InvalidArgumentException($e->getMessage());
throw new \InvalidArgumentException($e->getMessage());
}
// @codeCoverageIgnoreEnd
Log::debug('Detected file headers:', $headers);
@ -107,7 +106,7 @@ class RoleService
} catch (Exception $e) {
Log::error($e->getMessage());
throw new InvalidArgumentException($e->getMessage());
throw new \InvalidArgumentException($e->getMessage());
}
}
@ -152,7 +151,7 @@ class RoleService
} catch (Exception $e) {
Log::error($e->getMessage());
throw new InvalidArgumentException($e->getMessage());
throw new \InvalidArgumentException($e->getMessage());
}
/** @codeCoverageIgnoreEnd */
@ -247,7 +246,7 @@ class RoleService
}
foreach ($examples as $key => $list) {
$examples[$key] = array_unique($list);
$examples[$key] = array_filter($examples[$key], fn(string $value) => '' !== $value);
$examples[$key] = array_filter($examples[$key], fn (string $value) => '' !== $value);
}
return $examples;

3
app/Services/Camt/Conversion/RoutineManager.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Services\Camt\Conversion;
use Override;
use App\Exceptions\ImporterErrorException;
use App\Services\Session\Constants;
use App\Services\Shared\Authentication\IsRunningCli;
@ -73,7 +72,7 @@ class RoutineManager implements RoutineManagerInterface
}
}
#[Override]
#[\Override]
public function getServiceAccounts(): array
{
return [];

4
app/Services/Camt/Conversion/TransactionMapper.php

@ -601,8 +601,8 @@ class TransactionMapper
Log::error(
sprintf(
'Unknown transaction type: source = "%s", destination = "%s". Fall back to "withdrawal"',
$accountType['source'] !== null && $accountType['source'] !== '' && $accountType['source'] !== '0' ? $accountType['source'] : null,
$accountType['destination'] !== null && $accountType['destination'] !== '' && $accountType['destination'] !== '0' ? $accountType['destination'] : null
null !== $accountType['source'] && '' !== $accountType['source'] && '0' !== $accountType['source'] ? $accountType['source'] : null,
null !== $accountType['destination'] && '' !== $accountType['destination'] && '0' !== $accountType['destination'] ? $accountType['destination'] : null
)
); // 285
$current['type'] = 'withdrawal'; // line 382 / 383

2
app/Services/Camt/Transaction.php

@ -429,7 +429,7 @@ class Transaction
$opposingName = $relatedParty->getRelatedPartyType()->getName();
// but maybe you want also the entire address
if ($useEntireAddress && $addressLine = $this->generateAddressLine($relatedParty->getRelatedPartyType()->getAddress())) {
$opposingName .= sprintf(', %s',$addressLine);
$opposingName .= sprintf(', %s', $addressLine);
}
}

6
app/Services/Enums/AuthenticationStatus.php

@ -25,9 +25,9 @@ declare(strict_types=1);
namespace App\Services\Enums;
enum AuthenticationStatus : string
enum AuthenticationStatus: string
{
case AUTHENTICATED = 'authenticated';
case NODATA = 'nodata';
case ERROR = 'error';
case NODATA = 'nodata';
case ERROR = 'error';
}

4
app/Services/Nordigen/Conversion/Routine/TransactionProcessor.php

@ -50,8 +50,8 @@ class TransactionProcessor
private const string DATE_TIME_FORMAT = 'Y-m-d H:i:s';
private array $accounts;
private Configuration $configuration;
private ?Carbon $notAfter = null;
private ?Carbon $notBefore = null;
private ?Carbon $notAfter = null;
private ?Carbon $notBefore = null;
/**
* @throws ImporterErrorException

3
app/Services/Nordigen/Conversion/RoutineManager.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Services\Nordigen\Conversion;
use Override;
use App\Exceptions\AgreementExpiredException;
use App\Exceptions\ImporterErrorException;
use App\Services\Nordigen\Conversion\Routine\FilterTransactions;
@ -77,7 +76,7 @@ class RoutineManager implements RoutineManagerInterface
$this->transactionFilter = new FilterTransactions();
}
#[Override]
#[\Override]
public function getServiceAccounts(): array
{
return $this->transactionProcessor->getAccounts();

17
app/Services/Nordigen/Model/Transaction.php

@ -25,9 +25,6 @@ declare(strict_types=1);
namespace App\Services\Nordigen\Model;
use JsonException;
use DateTimeInterface;
use Validator;
use App\Rules\Iban;
use Carbon\Carbon;
use Carbon\Exceptions\InvalidFormatException;
@ -91,7 +88,7 @@ class Transaction
public string $ultimateDebtor;
// new fields
public ?Carbon $valueDate = null;
public ?Carbon $valueDate = null;
/**
* Creates a transaction from a downloaded array.
@ -201,7 +198,7 @@ class Transaction
try {
$hash = hash('sha256', json_encode($array, JSON_THROW_ON_ERROR));
Log::warning('Generated random transaction ID from array!');
} catch (JsonException $e) {
} catch (\JsonException $e) {
Log::error(sprintf('Could not parse array into JSON: %s', $e->getMessage()));
}
$object->transactionId = sprintf('ff3-%s', Uuid::uuid5(config('importer.namespace'), $hash));
@ -226,7 +223,7 @@ class Transaction
$object->additionalInformationStructured = $array['additional_information_structured'];
$object->balanceAfterTransaction = Balance::fromLocalArray($array['balance_after_transaction']);
$object->bankTransactionCode = $array['bank_transaction_code'];
$object->bookingDate = Carbon::createFromFormat(DateTimeInterface::W3C, $array['booking_date']);
$object->bookingDate = Carbon::createFromFormat(\DateTimeInterface::W3C, $array['booking_date']);
$object->checkId = $array['check_id'];
$object->creditorAgent = $array['creditor_agent'];
$object->creditorId = $array['creditor_id'];
@ -247,7 +244,7 @@ class Transaction
$object->transactionId = $array['transaction_id'];
$object->ultimateCreditor = $array['ultimate_creditor'];
$object->ultimateDebtor = $array['ultimate_debtor'];
$object->valueDate = Carbon::createFromFormat(DateTimeInterface::W3C, $array['value_date']);
$object->valueDate = Carbon::createFromFormat(\DateTimeInterface::W3C, $array['value_date']);
$object->transactionAmount = $array['transaction_amount']['amount'];
$object->currencyCode = $array['transaction_amount']['currency'];
$object->accountIdentifier = $array['account_identifier'];
@ -278,7 +275,7 @@ class Transaction
try {
$hash = hash('sha256', json_encode($array, JSON_THROW_ON_ERROR));
} catch (JsonException $e) {
} catch (\JsonException $e) {
Log::error(sprintf('Could not parse array into JSON: %s', $e->getMessage()));
}
$object->transactionId = (string) Uuid::uuid5(config('importer.namespace'), $hash);
@ -364,7 +361,7 @@ class Transaction
if ('' !== $this->creditorAccountIban) {
$data = ['iban' => $this->creditorAccountIban];
$rules = ['iban' => ['required', new Iban()]];
$validator = Validator::make($data, $rules);
$validator = \Validator::make($data, $rules);
if ($validator->fails()) {
Log::warning(sprintf('Destination IBAN is "%s" (creditor), but it is invalid, so ignoring', $this->creditorAccountIban));
@ -444,7 +441,7 @@ class Transaction
if ('' !== $this->debtorAccountIban) {
$data = ['iban' => $this->debtorAccountIban];
$rules = ['iban' => ['required', new Iban()]];
$validator = Validator::make($data, $rules);
$validator = \Validator::make($data, $rules);
if ($validator->fails()) {
Log::warning(sprintf('Source IBAN is "%s" (debtor), but it is invalid, so ignoring', $this->debtorAccountIban));

4
app/Services/Nordigen/Request/PostNewTokenRequest.php

@ -37,9 +37,7 @@ use Illuminate\Support\Facades\Log;
*/
class PostNewTokenRequest extends Request
{
public function __construct(private readonly string $identifier, private readonly string $key)
{
}
public function __construct(private readonly string $identifier, private readonly string $key) {}
public function get(): Response {}

5
app/Services/Nordigen/Request/Request.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Services\Nordigen\Request;
use JsonException;
use App\Exceptions\AgreementExpiredException;
use App\Exceptions\ImporterErrorException;
use App\Exceptions\ImporterHttpException;
@ -171,7 +170,7 @@ abstract class Request
try {
$json = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
} catch (\JsonException $e) {
throw new ImporterHttpException(
sprintf(
'Could not decode JSON (%s). Error[%d] is: %s. Response: %s',
@ -272,7 +271,7 @@ abstract class Request
try {
$json = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
} catch (\JsonException $e) {
// TODO error response, not an exception.
throw new ImporterHttpException(sprintf('AuthenticatedJsonPost JSON: %s', $e->getMessage()), 0, $e);
}

4
app/Services/Nordigen/Response/ArrayResponse.php

@ -33,7 +33,5 @@ use App\Services\Shared\Response\Response;
*/
class ArrayResponse extends Response
{
public function __construct(public array $data)
{
}
public function __construct(public array $data) {}
}

2
app/Services/Nordigen/Response/GetTransactionsResponse.php

@ -34,7 +34,7 @@ use Iterator;
/**
* Class GetTransactionsResponse
*/
class GetTransactionsResponse extends Response implements Iterator, Countable
class GetTransactionsResponse extends Response implements \Iterator, \Countable
{
private readonly Collection $collection;
private int $position = 0;

2
app/Services/Nordigen/Response/ListAccountsResponse.php

@ -35,7 +35,7 @@ use Iterator;
/**
* Class ListAccountsResponse
*/
class ListAccountsResponse extends Response implements Iterator, Countable
class ListAccountsResponse extends Response implements \Iterator, \Countable
{
private array $accounts;
private readonly Collection $collection;

2
app/Services/Nordigen/Response/ListBanksResponse.php

@ -35,7 +35,7 @@ use Iterator;
/**
* Class ListBanksResponse
*/
class ListBanksResponse extends Response implements Iterator, Countable
class ListBanksResponse extends Response implements \Iterator, \Countable
{
private readonly Collection $collection;
private array $countries;

6
app/Services/Shared/Configuration/Configuration.php

@ -25,8 +25,6 @@ declare(strict_types=1);
namespace App\Services\Shared\Configuration;
use UnexpectedValueException;
use DateTimeInterface;
use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
@ -196,7 +194,7 @@ class Configuration
return self::fromVersionThree($data);
}
throw new UnexpectedValueException(sprintf('Configuration file version "%s" cannot be parsed.', $version));
throw new \UnexpectedValueException(sprintf('Configuration file version "%s" cannot be parsed.', $version));
}
/**
@ -825,7 +823,7 @@ class Configuration
$array = [
'version' => $this->version,
'source' => sprintf('ff3-importer-%s', config('importer.version')),
'created_at' => date(DateTimeInterface::W3C),
'created_at' => date(\DateTimeInterface::W3C),
'date' => $this->date,
'default_account' => $this->defaultAccount,
'delimiter' => $this->delimiter,

6
app/Services/Shared/Conversion/GeneratesIdentifier.php

@ -25,8 +25,6 @@ declare(strict_types=1);
namespace App\Services\Shared\Conversion;
use Storage;
use Str;
use Illuminate\Support\Facades\Log;
/**
@ -45,10 +43,10 @@ trait GeneratesIdentifier
protected function generateIdentifier(): void
{
Log::debug('Going to generate conversion routine identifier.');
$disk = Storage::disk($this->diskName);
$disk = \Storage::disk($this->diskName);
$count = 0;
do {
$generatedId = sprintf('conversion-%s', Str::random(12));
$generatedId = sprintf('conversion-%s', \Str::random(12));
++$count;
Log::debug(sprintf('Attempt #%d results in "%s"', $count, $generatedId));
} while ($count < 30 && $disk->exists($generatedId));

28
app/Services/Shared/Conversion/RoutineStatusManager.php

@ -25,8 +25,6 @@ declare(strict_types=1);
namespace App\Services\Shared\Conversion;
use Storage;
use JsonException;
use App\Exceptions\ImporterErrorException;
use App\Services\Session\Constants;
use Illuminate\Contracts\Filesystem\FileNotFoundException;
@ -46,13 +44,13 @@ class RoutineStatusManager
$lineNo = $index + 1;
Log::debug(sprintf('Add error on index #%d (line no. %d): %s', $index, $lineNo, $error));
$disk = Storage::disk(self::DISK_NAME);
$disk = \Storage::disk(self::DISK_NAME);
try {
if ($disk->exists($identifier)) {
try {
$status = ConversionStatus::fromArray(json_decode((string) $disk->get($identifier), true, 512, JSON_THROW_ON_ERROR));
} catch (JsonException $e) {
} catch (\JsonException $e) {
Log::error($e->getMessage());
$status = new ConversionStatus();
}
@ -70,13 +68,13 @@ class RoutineStatusManager
$lineNo = $index + 1;
Log::debug(sprintf('Add rate limit message on index #%d (line no. %d): %s', $index, $lineNo, $message));
$disk = Storage::disk(self::DISK_NAME);
$disk = \Storage::disk(self::DISK_NAME);
try {
if ($disk->exists($identifier)) {
try {
$status = ConversionStatus::fromArray(json_decode((string) $disk->get($identifier), true, 512, JSON_THROW_ON_ERROR));
} catch (JsonException $e) {
} catch (\JsonException $e) {
Log::error($e->getMessage());
$status = new ConversionStatus();
}
@ -93,11 +91,11 @@ class RoutineStatusManager
{
Log::debug(sprintf('Now in storeConversionStatus(%s): %s', $identifier, $status->status));
Log::debug(sprintf('Messages: %d, warnings: %d, errors: %d', count($status->messages), count($status->warnings), count($status->errors)));
$disk = Storage::disk(self::DISK_NAME);
$disk = \Storage::disk(self::DISK_NAME);
try {
$disk->put($identifier, json_encode($status->toArray(), JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT));
} catch (JsonException $e) {
} catch (\JsonException $e) {
// do nothing
Log::error($e->getMessage());
}
@ -108,13 +106,13 @@ class RoutineStatusManager
$lineNo = $index + 1;
Log::debug(sprintf('Add message on index #%d (line no. %d): %s', $index, $lineNo, $message));
$disk = Storage::disk(self::DISK_NAME);
$disk = \Storage::disk(self::DISK_NAME);
try {
if ($disk->exists($identifier)) {
try {
$status = ConversionStatus::fromArray(json_decode((string) $disk->get($identifier), true, 512, JSON_THROW_ON_ERROR));
} catch (JsonException $e) {
} catch (\JsonException $e) {
Log::error($e->getMessage());
$status = new ConversionStatus();
}
@ -132,13 +130,13 @@ class RoutineStatusManager
$lineNo = $index + 1;
Log::debug(sprintf('Add warning on index #%d (line no. %d): %s', $index, $lineNo, $warning));
$disk = Storage::disk(self::DISK_NAME);
$disk = \Storage::disk(self::DISK_NAME);
try {
if ($disk->exists($identifier)) {
try {
$status = ConversionStatus::fromArray(json_decode((string) $disk->get($identifier), true, 512, JSON_THROW_ON_ERROR));
} catch (JsonException $e) {
} catch (\JsonException $e) {
Log::error($e->getMessage());
$status = new ConversionStatus();
}
@ -177,14 +175,14 @@ class RoutineStatusManager
public static function startOrFindConversion(string $identifier): ConversionStatus
{
Log::debug(sprintf('Now in startOrFindConversion(%s)', $identifier));
$disk = Storage::disk(self::DISK_NAME);
$disk = \Storage::disk(self::DISK_NAME);
// Log::debug(sprintf('Try to see if file exists for conversion "%s".', $identifier));
if ($disk->exists($identifier)) {
// Log::debug(sprintf('Status file exists for conversion "%s".', $identifier));
try {
$array = json_decode((string) $disk->get($identifier), true, 512, JSON_THROW_ON_ERROR);
$status = ConversionStatus::fromArray($array);
} catch (FileNotFoundException|JsonException $e) {
} catch (FileNotFoundException|\JsonException $e) {
Log::error($e->getMessage());
$status = new ConversionStatus();
}
@ -197,7 +195,7 @@ class RoutineStatusManager
try {
$disk->put($identifier, json_encode($status->toArray(), JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT));
} catch (JsonException $e) {
} catch (\JsonException $e) {
Log::error($e->getMessage());
}

5
app/Services/Shared/File/FileContentSherlock.php

@ -24,7 +24,6 @@ declare(strict_types=1);
namespace App\Services\Shared\File;
use Exception;
use Genkgo\Camt\Config;
use Genkgo\Camt\Reader;
use Illuminate\Support\Facades\Log;
@ -52,7 +51,7 @@ class FileContentSherlock
Log::debug('CAMT.053 Check on file: positive');
return 'camt';
} catch (Exception $e) {
} catch (\Exception $e) {
Log::debug('CAMT.053 Check on file: negative');
Log::debug($e->getMessage());
}
@ -71,7 +70,7 @@ class FileContentSherlock
Log::debug('CAMT.053 Check of content: positive');
return 'camt';
} catch (Exception) {
} catch (\Exception) {
Log::debug('CAMT.053 Check of content: negative');
// Log::debug($e->getMessage());
}

28
app/Services/Shared/Import/Status/SubmissionStatusManager.php

@ -25,8 +25,6 @@ declare(strict_types=1);
namespace App\Services\Shared\Import\Status;
use Storage;
use JsonException;
use App\Services\Session\Constants;
use App\Services\Shared\Submission\GeneratesIdentifier;
use Illuminate\Contracts\Filesystem\FileNotFoundException;
@ -47,13 +45,13 @@ class SubmissionStatusManager
{
$lineNo = $index + 1;
Log::debug(sprintf('Add error on index #%d (line no. %d): %s', $index, $lineNo, $error));
$disk = Storage::disk(self::DISK_NAME);
$disk = \Storage::disk(self::DISK_NAME);
try {
if ($disk->exists($identifier)) {
try {
$status = SubmissionStatus::fromArray(json_decode((string) $disk->get($identifier), true, 512, JSON_THROW_ON_ERROR));
} catch (JsonException) {
} catch (\JsonException) {
$status = new SubmissionStatus();
}
$status->errors[$index] ??= [];
@ -72,11 +70,11 @@ class SubmissionStatusManager
{
Log::debug(sprintf('Now in %s(%s): %s', __METHOD__, $identifier, $status->status));
Log::debug(sprintf('Messages: %d, warnings: %d, errors: %d', count($status->messages), count($status->warnings), count($status->errors)));
$disk = Storage::disk(self::DISK_NAME);
$disk = \Storage::disk(self::DISK_NAME);
try {
$disk->put($identifier, json_encode($status->toArray(), JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT));
} catch (JsonException $e) {
} catch (\JsonException $e) {
// do nothing
Log::error($e->getMessage());
}
@ -87,13 +85,13 @@ class SubmissionStatusManager
$lineNo = $index + 1;
Log::debug(sprintf('Add message on index #%d (line no. %d): %s', $index, $lineNo, $message));
$disk = Storage::disk(self::DISK_NAME);
$disk = \Storage::disk(self::DISK_NAME);
try {
if ($disk->exists($identifier)) {
try {
$status = SubmissionStatus::fromArray(json_decode((string) $disk->get($identifier), true, 512, JSON_THROW_ON_ERROR));
} catch (JsonException) {
} catch (\JsonException) {
$status = new SubmissionStatus();
}
$status->messages[$index] ??= [];
@ -113,13 +111,13 @@ class SubmissionStatusManager
$lineNo = $index + 1;
Log::debug(sprintf('Add warning on index #%d (line no. %d): %s', $index, $lineNo, $warning));
$disk = Storage::disk(self::DISK_NAME);
$disk = \Storage::disk(self::DISK_NAME);
try {
if ($disk->exists($identifier)) {
try {
$status = SubmissionStatus::fromArray(json_decode((string) $disk->get($identifier), true, 512, JSON_THROW_ON_ERROR));
} catch (JsonException) {
} catch (\JsonException) {
$status = new SubmissionStatus();
}
$status->warnings[$index] ??= [];
@ -138,13 +136,13 @@ class SubmissionStatusManager
{
Log::debug(sprintf('Update progress for %s: %d/%d transactions', $identifier, $currentTransaction, $totalTransactions));
$disk = Storage::disk(self::DISK_NAME);
$disk = \Storage::disk(self::DISK_NAME);
try {
if ($disk->exists($identifier)) {
try {
$status = SubmissionStatus::fromArray(json_decode((string) $disk->get($identifier), true, 512, JSON_THROW_ON_ERROR));
} catch (JsonException) {
} catch (\JsonException) {
$status = new SubmissionStatus();
}
@ -186,7 +184,7 @@ class SubmissionStatusManager
public static function startOrFindSubmission(string $identifier): SubmissionStatus
{
Log::debug(sprintf('Now in startOrFindJob(%s)', $identifier));
$disk = Storage::disk(self::DISK_NAME);
$disk = \Storage::disk(self::DISK_NAME);
try {
Log::debug(sprintf('Try to see if file exists for job %s.', $identifier));
@ -196,7 +194,7 @@ class SubmissionStatusManager
try {
$array = json_decode((string) $disk->get($identifier), true, 512, JSON_THROW_ON_ERROR);
$status = SubmissionStatus::fromArray($array);
} catch (FileNotFoundException|JsonException $e) {
} catch (FileNotFoundException|\JsonException $e) {
Log::error($e->getMessage());
$status = new SubmissionStatus();
}
@ -214,7 +212,7 @@ class SubmissionStatusManager
try {
$json = json_encode($status->toArray(), JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT);
} catch (JsonException $e) {
} catch (\JsonException $e) {
Log::error($e->getMessage());
$json = '{}';
}

6
app/Services/Shared/Submission/GeneratesIdentifier.php

@ -25,8 +25,6 @@ declare(strict_types=1);
namespace App\Services\Shared\Submission;
use Storage;
use Str;
use Illuminate\Support\Facades\Log;
/**
@ -40,10 +38,10 @@ trait GeneratesIdentifier
public function generateIdentifier(): string
{
Log::debug('Going to generate submission routine identifier.');
$disk = Storage::disk($this->diskName);
$disk = \Storage::disk($this->diskName);
$count = 0;
do {
$generatedId = sprintf('submission-%s', Str::random(12));
$generatedId = sprintf('submission-%s', \Str::random(12));
++$count;
Log::debug(sprintf('Attempt #%d results in "%s"', $count, $generatedId));
} while ($count < 30 && $disk->exists($generatedId));

19
app/Services/SimpleFIN/Conversion/AccountMapper.php

@ -26,7 +26,6 @@ declare(strict_types=1);
namespace App\Services\SimpleFIN\Conversion;
use Carbon\Carbon;
use Exception;
use App\Exceptions\ImporterErrorException;
use App\Services\CSV\Converter\Iban as IbanConverter;
use App\Services\Shared\Authentication\SecretManager;
@ -79,7 +78,7 @@ class AccountMapper
if ('map' === $mappingConfig['action'] && isset($mappingConfig['firefly_account_id'])) {
// Map to existing account
$fireflyAccount = $this->getFireflyAccountById((int) $mappingConfig['firefly_account_id']);
if ($fireflyAccount instanceof \GrumpyDictator\FFIIIApiSupport\Model\Account) {
if ($fireflyAccount instanceof Account) {
$mapping[$accountKey] = [
'simplefin_account' => $simplefinAccount,
'firefly_account_id' => $fireflyAccount->id,
@ -91,7 +90,7 @@ class AccountMapper
if ('create' === $mappingConfig['action']) {
// Create new account
$fireflyAccount = $this->createFireflyAccount($simplefinAccount, $mappingConfig);
if ($fireflyAccount instanceof \GrumpyDictator\FFIIIApiSupport\Model\Account) {
if ($fireflyAccount instanceof Account) {
$mapping[$accountKey] = [
'simplefin_account' => $simplefinAccount,
'firefly_account_id' => $fireflyAccount->id,
@ -104,7 +103,7 @@ class AccountMapper
if (!isset($configuration['account_mapping'][$accountKey])) {
// Auto-map by searching for existing accounts
$fireflyAccount = $this->findMatchingFireflyAccount($simplefinAccount);
if ($fireflyAccount instanceof \GrumpyDictator\FFIIIApiSupport\Model\Account) {
if ($fireflyAccount instanceof Account) {
$mapping[$accountKey] = [
'simplefin_account' => $simplefinAccount,
'firefly_account_id' => $fireflyAccount->id,
@ -112,7 +111,7 @@ class AccountMapper
'action' => 'auto_map',
];
}
if (!$fireflyAccount instanceof \GrumpyDictator\FFIIIApiSupport\Model\Account) {
if (!$fireflyAccount instanceof Account) {
// No mapping found - will need user input
$mapping[$accountKey] = [
'simplefin_account' => $simplefinAccount,
@ -145,7 +144,7 @@ class AccountMapper
$this->loadFireflyAccounts();
// Try to find by name first
$matchingAccounts = array_filter($this->fireflyAccounts, fn(Account $account) => strtolower((string) $account->name) === strtolower($simplefinAccount->getName()));
$matchingAccounts = array_filter($this->fireflyAccounts, fn (Account $account) => strtolower((string) $account->name) === strtolower($simplefinAccount->getName()));
if (0 === count($matchingAccounts)) {
return reset($matchingAccounts);
@ -242,7 +241,7 @@ class AccountMapper
if ($response instanceof PostAccountResponse) {
$account = $response->getAccount();
if ($account instanceof \GrumpyDictator\FFIIIApiSupport\Model\Account) {
if ($account instanceof Account) {
Log::info(sprintf('Successfully created account "%s" with ID %d', $accountName, $account->id));
// Add to our local cache
@ -261,7 +260,7 @@ class AccountMapper
Log::error(sprintf('API error creating account "%s": %s', $accountName, $e->getMessage()));
return null;
} catch (Exception $e) {
} catch (\Exception $e) {
Log::error(sprintf('Unexpected error creating account "%s": %s', $accountName, $e->getMessage()));
return null;
@ -295,7 +294,7 @@ class AccountMapper
}
// 3. Final fallback
return $currency !== '' && $currency !== '0' ? $currency : 'EUR';
return '' !== $currency && '0' !== $currency ? $currency : 'EUR';
}
/**
@ -459,7 +458,7 @@ class AccountMapper
// Try to suggest a matching account
$suggested = $this->findMatchingFireflyAccount($simplefinAccount);
if ($suggested instanceof \GrumpyDictator\FFIIIApiSupport\Model\Account) {
if ($suggested instanceof Account) {
$options['suggested_account'] = [
'id' => $suggested->id,
'name' => $suggested->name,

7
app/Services/SimpleFIN/Conversion/RoutineManager.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Services\SimpleFIN\Conversion;
use Override;
use Carbon\Carbon;
use App\Exceptions\ImporterErrorException;
use App\Services\Session\Constants;
@ -65,7 +64,7 @@ class RoutineManager implements RoutineManagerInterface
return $this->identifier;
}
#[Override]
#[\Override]
public function getServiceAccounts(): array
{
return session()->get(Constants::SIMPLEFIN_ACCOUNTS_DATA, []);
@ -122,7 +121,7 @@ class RoutineManager implements RoutineManagerInterface
continue;
}
$simplefinAccountData = array_find($allAccountsSimpleFINData, fn($accountData) => $accountData['id'] === $simplefinAccountId);
$simplefinAccountData = array_find($allAccountsSimpleFINData, fn ($accountData) => $accountData['id'] === $simplefinAccountId);
if (!$simplefinAccountData) {
Log::error("SimpleFIN account data not found for ID: {$simplefinAccountId}");
@ -179,7 +178,7 @@ class RoutineManager implements RoutineManagerInterface
}
}
}
$currentSimpleFINAccountData = array_find($allAccountsSimpleFINData, fn($accountDataFromArrayInLoop) => isset($accountDataFromArrayInLoop['id']) && $accountDataFromArrayInLoop['id'] === $simplefinAccountId);
$currentSimpleFINAccountData = array_find($allAccountsSimpleFINData, fn ($accountDataFromArrayInLoop) => isset($accountDataFromArrayInLoop['id']) && $accountDataFromArrayInLoop['id'] === $simplefinAccountId);
if (null === $currentSimpleFINAccountData) {
Log::error('Failed to find SimpleFIN account raw data in session for current account ID during transformation.', ['simplefin_account_id_sought' => $simplefinAccountId]);

9
app/Services/SimpleFIN/Conversion/TransactionTransformer.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Services\SimpleFIN\Conversion;
use Exception;
use App\Support\Http\CollectsAccounts;
use Carbon\Carbon;
use App\Services\Shared\Authentication\SecretManager;
@ -189,7 +188,7 @@ class TransactionTransformer
// Try to find existing expense or revenue account first
$existingAccount = $this->findExistingAccount($description, $isDeposit);
if ($existingAccount !== null && $existingAccount !== []) {
if (null !== $existingAccount && [] !== $existingAccount) {
return [
'id' => $existingAccount['id'],
'name' => $existingAccount['name'],
@ -207,7 +206,7 @@ class TransactionTransformer
if (0 === count($accountsToCheck)) {
$clusteredAccountName = $this->findClusteredAccountName($description, $isDeposit);
if ($clusteredAccountName !== null && $clusteredAccountName !== '' && $clusteredAccountName !== '0') {
if (null !== $clusteredAccountName && '' !== $clusteredAccountName && '0' !== $clusteredAccountName) {
return [
'id' => null,
'name' => $clusteredAccountName,
@ -486,7 +485,7 @@ class TransactionTransformer
));
$this->accountsCollected = true;
} catch (Exception $e) {
} catch (\Exception $e) {
Log::error(sprintf('Failed to collect accounts: %s', $e->getMessage()));
Log::debug('Continuing without smart expense matching due to collection failure');
$this->expenseAccounts = [];
@ -526,7 +525,7 @@ class TransactionTransformer
// Try fuzzy matching if no exact match found
$bestMatch = $this->findBestFuzzyMatch($normalizedDescription, $accountsToSearch);
if ($bestMatch !== null && $bestMatch !== []) {
if (null !== $bestMatch && [] !== $bestMatch) {
Log::debug(sprintf(
'Fuzzy match found: "%s" -> "%s" (similarity: %.2f)',
$description,

11
app/Services/SimpleFIN/Model/Account.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Services\SimpleFIN\Model;
use InvalidArgumentException;
use Carbon\Carbon;
/**
@ -184,17 +183,17 @@ class Account
foreach ($requiredFields as $field) {
if (!array_key_exists($field, $data)) {
throw new InvalidArgumentException(sprintf('Missing required field: %s', $field));
throw new \InvalidArgumentException(sprintf('Missing required field: %s', $field));
}
}
// Validate organization structure
if (!is_array($data['org'])) {
throw new InvalidArgumentException('Organization must be an array');
throw new \InvalidArgumentException('Organization must be an array');
}
if (!array_key_exists('sfin-url', $data['org']) && null !== $data['org']['sfin-url']) {
throw new InvalidArgumentException('Organization must have sfin-url');
throw new \InvalidArgumentException('Organization must have sfin-url');
}
@ -204,12 +203,12 @@ class Account
&& null !== $data['org']['domain']
&& null !== $data['org']['name']
) {
throw new InvalidArgumentException('Organization must have either domain or name');
throw new \InvalidArgumentException('Organization must have either domain or name');
}
// Validate balance-date is numeric
if (!is_numeric($data['balance-date'])) {
throw new InvalidArgumentException('Balance date must be a numeric timestamp');
throw new \InvalidArgumentException('Balance date must be a numeric timestamp');
}
}
}

13
app/Services/SimpleFIN/Model/Transaction.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Services\SimpleFIN\Model;
use InvalidArgumentException;
use Carbon\Carbon;
/**
@ -111,7 +110,7 @@ class Transaction
public function getTransactedAtAsCarbon(): ?Carbon
{
return $this->transactedAt !== null && $this->transactedAt !== 0 ? Carbon::createFromTimestamp($this->transactedAt) : null;
return null !== $this->transactedAt && 0 !== $this->transactedAt ? Carbon::createFromTimestamp($this->transactedAt) : null;
}
public function isPending(): bool
@ -173,28 +172,28 @@ class Transaction
foreach ($requiredFields as $field) {
if (!array_key_exists($field, $data)) {
throw new InvalidArgumentException(sprintf('Missing required field: %s', $field));
throw new \InvalidArgumentException(sprintf('Missing required field: %s', $field));
}
}
// Validate posted is numeric
if (!is_numeric($data['posted'])) {
throw new InvalidArgumentException('Posted date must be a numeric timestamp');
throw new \InvalidArgumentException('Posted date must be a numeric timestamp');
}
// Validate amount is numeric string
if (!is_numeric($data['amount'])) {
throw new InvalidArgumentException('Amount must be a numeric string');
throw new \InvalidArgumentException('Amount must be a numeric string');
}
// Validate transacted_at if present
if (isset($data['transacted_at']) && !is_numeric($data['transacted_at'])) {
throw new InvalidArgumentException('Transacted at must be a numeric timestamp');
throw new \InvalidArgumentException('Transacted at must be a numeric timestamp');
}
// Validate pending if present
if (isset($data['pending']) && !is_bool($data['pending'])) {
throw new InvalidArgumentException('Pending must be a boolean');
throw new \InvalidArgumentException('Pending must be a boolean');
}
}
}

15
app/Services/SimpleFIN/SimpleFINService.php

@ -25,9 +25,6 @@ declare(strict_types=1);
namespace App\Services\SimpleFIN;
use DateTime;
use DateTimeZone;
use Exception;
use App\Exceptions\ImporterErrorException;
use App\Exceptions\ImporterHttpException;
use App\Services\Session\Constants;
@ -158,15 +155,15 @@ class SimpleFINService
if (isset($dateRange['start']) && '' !== (string)$dateRange['start']) {
try {
$startDateTimestamp = new DateTime($dateRange['start'], new DateTimeZone('UTC'))->setTime(0, 0, 0)->getTimestamp();
} catch (Exception $e) {
$startDateTimestamp = new \DateTime($dateRange['start'], new \DateTimeZone('UTC'))->setTime(0, 0, 0)->getTimestamp();
} catch (\Exception $e) {
Log::warning('Invalid start date format for SimpleFIN transaction filtering.', ['date' => $dateRange['start'], 'error' => $e->getMessage()]);
}
}
if (isset($dateRange['end']) && '' !== (string)$dateRange['end']) {
try {
$endDateTimestamp = new DateTime($dateRange['end'], new DateTimeZone('UTC'))->setTime(23, 59, 59)->getTimestamp();
} catch (Exception $e) {
$endDateTimestamp = new \DateTime($dateRange['end'], new \DateTimeZone('UTC'))->setTime(23, 59, 59)->getTimestamp();
} catch (\Exception $e) {
Log::warning('Invalid end date format for SimpleFIN transaction filtering.', ['date' => $dateRange['end'], 'error' => $e->getMessage()]);
}
}
@ -323,10 +320,10 @@ class SimpleFINService
// Log the actual response for debugging
Log::error(sprintf('DETAILED 403 ERROR - URL: %s, Response: %s', $claimUrl, $responseBody));
throw new ImporterErrorException(sprintf('SimpleFIN claim URL exchange failed (403 Forbidden): %s', $responseBody !== '' && $responseBody !== '0' ? $responseBody : 'No response body available'));
throw new ImporterErrorException(sprintf('SimpleFIN claim URL exchange failed (403 Forbidden): %s', '' !== $responseBody && '0' !== $responseBody ? $responseBody : 'No response body available'));
}
throw new ImporterErrorException(sprintf('Failed to exchange SimpleFIN claim URL: HTTP %d error - %s', $statusCode, $responseBody !== '' && $responseBody !== '0' ? $responseBody : $e->getMessage()));
throw new ImporterErrorException(sprintf('Failed to exchange SimpleFIN claim URL: HTTP %d error - %s', $statusCode, '' !== $responseBody && '0' !== $responseBody ? $responseBody : $e->getMessage()));
} catch (GuzzleException $e) {
Log::error(sprintf('Failed to exchange SimpleFIN claim URL: %s', $e->getMessage()));

6
app/Services/SimpleFIN/Validation/ConfigurationContractValidator.php

@ -41,9 +41,9 @@ use Illuminate\Support\Facades\Log;
*/
class ConfigurationContractValidator
{
private array $errors = [];
private array $warnings = [];
private array $existingAccounts = [];
private array $errors = [];
private array $warnings = [];
private array $existingAccounts = [];
private const array REQUIRED_ACCOUNT_TYPES = ['asset', 'liability', 'expense', 'revenue'];
private const array VALID_ACCOUNT_ROLES = ['defaultAsset', 'sharedAsset', 'savingAsset', 'ccAsset', 'cashWalletAsset'];

4
app/Services/Spectre/Conversion/Routine/TransactionProcessor.php

@ -46,8 +46,8 @@ class TransactionProcessor
private const string DATE_TIME_FORMAT = 'Y-m-d H:i:s';
private Configuration $configuration;
private string $downloadIdentifier;
private ?Carbon $notAfter = null;
private ?Carbon $notBefore = null;
private ?Carbon $notAfter = null;
private ?Carbon $notBefore = null;
/**
* @throws ImporterHttpException

3
app/Services/Spectre/Conversion/RoutineManager.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Services\Spectre\Conversion;
use Override;
use App\Exceptions\ImporterHttpException;
use App\Services\Shared\Configuration\Configuration;
use App\Services\Shared\Conversion\CombinedProgressInformation;
@ -75,7 +74,7 @@ class RoutineManager implements RoutineManagerInterface
}
}
#[Override]
#[\Override]
public function getServiceAccounts(): array
{
return [];

59
app/Services/Spectre/Model/TransactionExtra.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Services\Spectre\Model;
use Exception;
use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
@ -34,40 +33,40 @@ use Illuminate\Support\Facades\Log;
*/
class TransactionExtra
{
private ?string $accountBalanceSnapshot = null;
private ?string $accountNumber = null;
private ?string $additional = null;
private ?string $assetAmount = null;
private ?string $assetCode = null;
private ?string $accountBalanceSnapshot = null;
private ?string $accountNumber = null;
private ?string $additional = null;
private ?string $assetAmount = null;
private ?string $assetCode = null;
private ?string $categorizationConfidence = null;
private ?string $checkNumber = null;
private ?string $customerCategoryCode = null;
private ?string $customerCategoryName = null;
private ?string $id = null;
private ?string $information = null;
private ?string $mcc = null;
private ?string $originalAmount = null;
private ?string $originalCategory = null;
private ?string $originalCurrencyCode = null;
private ?string $originalSubCategory = null;
private ?string $payee = null;
private ?string $payeeInformation = null;
private ?string $payer = null;
private ?string $payerInformation = null;
private ?bool $possibleDuplicate = null;
private ?Carbon $postingDate = null;
private ?Carbon $postingTime = null;
private ?string $recordNumber = null;
private ?array $tags = null;
private ?Carbon $time = null;
private ?string $type = null;
private ?string $unitPrice = null;
private ?string $units = null;
private ?string $checkNumber = null;
private ?string $customerCategoryCode = null;
private ?string $customerCategoryName = null;
private ?string $id = null;
private ?string $information = null;
private ?string $mcc = null;
private ?string $originalAmount = null;
private ?string $originalCategory = null;
private ?string $originalCurrencyCode = null;
private ?string $originalSubCategory = null;
private ?string $payee = null;
private ?string $payeeInformation = null;
private ?string $payer = null;
private ?string $payerInformation = null;
private ?bool $possibleDuplicate = null;
private ?Carbon $postingDate = null;
private ?Carbon $postingTime = null;
private ?string $recordNumber = null;
private ?array $tags = null;
private ?Carbon $time = null;
private ?string $type = null;
private ?string $unitPrice = null;
private ?string $units = null;
/**
* TransactionExtra constructor.
*
* @throws Exception
* @throws \Exception
*/
private function __construct() {}

29
app/Services/Spectre/Request/Request.php

@ -25,9 +25,6 @@ declare(strict_types=1);
namespace App\Services\Spectre\Request;
use JsonException;
use Exception;
use RuntimeException;
use Carbon\Carbon;
use App\Exceptions\ImporterErrorException;
use App\Exceptions\ImporterHttpException;
@ -135,7 +132,7 @@ abstract class Request
try {
$json = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
} catch (\JsonException $e) {
throw new ImporterHttpException(
sprintf(
'Could not decode JSON (%s). Error[%d] is: %s. Response: %s',
@ -222,7 +219,7 @@ abstract class Request
try {
$body = json_encode($data, JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
} catch (\JsonException $e) {
throw new ImporterErrorException($e->getMessage());
}
@ -231,13 +228,13 @@ abstract class Request
try {
$client = $this->getClient();
$res = $client->request('POST', $fullUrl, ['headers' => $headers, 'body' => $body]);
} catch (Exception|GuzzleException $e) {
} catch (\Exception|GuzzleException $e) {
throw new ImporterHttpException(sprintf('Guzzle Exception: %s', $e->getMessage()));
}
try {
$body = $res->getBody()->getContents();
} catch (RuntimeException $e) {
} catch (\RuntimeException $e) {
Log::error(sprintf('sendSignedSpectrePost: Could not get body from SpectreRequest::POST result: %s', $e->getMessage()));
$body = '{}';
}
@ -247,7 +244,7 @@ abstract class Request
try {
$json = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
} catch (\JsonException $e) {
throw new ImporterHttpException($e->getMessage());
}
$json['ResponseHeaders'] = $responseHeaders;
@ -288,7 +285,7 @@ abstract class Request
try {
$body = json_encode($data, JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
} catch (\JsonException $e) {
Log::error($e->getMessage());
}
if ('{}' !== (string) $body) {
@ -300,7 +297,7 @@ abstract class Request
try {
$client = $this->getClient();
$res = $client->request('POST', $fullUrl, $opts);
} catch (Exception|GuzzleException $e) {
} catch (\Exception|GuzzleException $e) {
Log::error($e->getMessage());
throw new ImporterHttpException(sprintf('Guzzle Exception: %s', $e->getMessage()));
@ -308,7 +305,7 @@ abstract class Request
try {
$body = $res->getBody()->getContents();
} catch (RuntimeException $e) {
} catch (\RuntimeException $e) {
Log::error(sprintf('sendUnsignedSpectrePost: Could not get body from SpectreRequest::POST result: %s', $e->getMessage()));
$body = '{}';
}
@ -318,7 +315,7 @@ abstract class Request
try {
$json = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
} catch (\JsonException $e) {
throw new ImporterHttpException($e->getMessage());
}
$json['ResponseHeaders'] = $responseHeaders;
@ -343,7 +340,7 @@ abstract class Request
try {
$body = json_encode($data, JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
} catch (\JsonException $e) {
Log::error($e->getMessage());
}
if ('{}' !== (string) $body) {
@ -365,7 +362,7 @@ abstract class Request
try {
$json = json_decode((string) $e->getResponse()->getBody(), true, 512, JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
} catch (\JsonException $e) {
Log::error($e->getMessage());
}
$json['ResponseHeaders'] = $responseHeaders;
@ -383,7 +380,7 @@ abstract class Request
try {
$body = $res->getBody()->getContents();
} catch (RuntimeException $e) {
} catch (\RuntimeException $e) {
Log::error(sprintf('sendUnsignedSpectrePut: Could not get body from SpectreRequest::POST result: %s', $e->getMessage()));
$body = '{}';
}
@ -393,7 +390,7 @@ abstract class Request
try {
$json = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
} catch (JsonException $e) {
} catch (\JsonException $e) {
throw new ImporterHttpException($e->getMessage());
}
$json['ResponseHeaders'] = $responseHeaders;

2
app/Services/Spectre/Response/GetAccountsResponse.php

@ -34,7 +34,7 @@ use Iterator;
/**
* Class GetAccountsResponse
*/
class GetAccountsResponse extends Response implements Iterator, Countable
class GetAccountsResponse extends Response implements \Iterator, \Countable
{
private readonly Collection $collection;

2
app/Services/Spectre/Response/GetTransactionsResponse.php

@ -34,7 +34,7 @@ use Iterator;
/**
* Class GetTransactionsResponse
*/
class GetTransactionsResponse extends Response implements Iterator, Countable
class GetTransactionsResponse extends Response implements \Iterator, \Countable
{
private readonly Collection $collection;
private int $position = 0;

2
app/Services/Spectre/Response/ListConnectionsResponse.php

@ -34,7 +34,7 @@ use Iterator;
/**
* Class ListConnectionsResponse
*/
class ListConnectionsResponse extends Response implements Iterator, Countable
class ListConnectionsResponse extends Response implements \Iterator, \Countable
{
private readonly Collection $collection;
private int $position = 0;

2
app/Services/Spectre/Response/ListCustomersResponse.php

@ -34,7 +34,7 @@ use Iterator;
/**
* Class ListCustomersResponse
*/
class ListCustomersResponse extends Response implements Iterator, Countable
class ListCustomersResponse extends Response implements \Iterator, \Countable
{
private readonly Collection $collection;
private int $position = 0;

4
app/Services/Spectre/Response/PutRefreshConnectionResponse.php

@ -32,7 +32,5 @@ use App\Services\Shared\Response\Response;
*/
class PutRefreshConnectionResponse extends Response
{
public function __construct(private readonly array $data)
{
}
public function __construct(private readonly array $data) {}
}

13
app/Services/Storage/StorageService.php

@ -25,9 +25,6 @@ declare(strict_types=1);
namespace App\Services\Storage;
use Storage;
use UnexpectedValueException;
use JsonException;
use App\Exceptions\ImporterErrorException;
use Illuminate\Support\Facades\Log;
use League\Flysystem\FilesystemException;
@ -39,9 +36,9 @@ class StorageService
{
public static function getContent(string $name, bool $convert = false): string
{
$disk = Storage::disk('uploads');
$disk = \Storage::disk('uploads');
if (!$disk->exists($name)) {
throw new UnexpectedValueException(sprintf('No such file %s', $name));
throw new \UnexpectedValueException(sprintf('No such file %s', $name));
}
if (false === $convert) {
return $disk->get($name);
@ -63,11 +60,11 @@ class StorageService
/**
* @throws FilesystemException
* @throws JsonException
* @throws \JsonException
*/
public static function storeArray(array $array): string
{
$disk = Storage::disk('uploads');
$disk = \Storage::disk('uploads');
$json = json_encode($array, JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT, 256);
$fileName = hash('sha256', $json);
@ -88,7 +85,7 @@ class StorageService
public static function storeContent(string $content): string
{
$fileName = hash('sha256', $content);
$disk = Storage::disk('uploads');
$disk = \Storage::disk('uploads');
if ('{}' === $content) {
throw new ImporterErrorException('Content is {}');
}

3
app/Support/Internal/CollectsAccounts.php

@ -25,7 +25,6 @@ declare(strict_types=1);
namespace App\Support\Internal;
use Exception;
use App\Exceptions\AgreementExpiredException;
use App\Exceptions\ImporterErrorException;
use App\Exceptions\ImporterHttpException;
@ -117,7 +116,7 @@ trait CollectsAccounts
]);
// Return the (potentially partially filled) $accounts array so the app doesn't hard crash.
// The view should handle cases where account lists are empty.
} catch (Exception $e) {
} catch (\Exception $e) {
Log::error('CollectsAccounts::getFireflyIIIAccounts - Generic Exception while fetching Firefly III accounts.', [
'message' => $e->getMessage(),
'code' => $e->getCode(),

3
app/User.php

@ -54,10 +54,9 @@ class User extends Authenticatable
= [
'password', 'remember_token',
];
/**
* The attributes that should be cast to native types.
*
* @return array
*/
protected function casts(): array
{

13
composer.lock

@ -3383,21 +3383,20 @@
},
{
"name": "ramsey/uuid",
"version": "4.8.1",
"version": "4.9.0",
"source": {
"type": "git",
"url": "https://github.com/ramsey/uuid.git",
"reference": "fdf4dd4e2ff1813111bd0ad58d7a1ddbb5b56c28"
"reference": "4e0e23cc785f0724a0e838279a9eb03f28b092a0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ramsey/uuid/zipball/fdf4dd4e2ff1813111bd0ad58d7a1ddbb5b56c28",
"reference": "fdf4dd4e2ff1813111bd0ad58d7a1ddbb5b56c28",
"url": "https://api.github.com/repos/ramsey/uuid/zipball/4e0e23cc785f0724a0e838279a9eb03f28b092a0",
"reference": "4e0e23cc785f0724a0e838279a9eb03f28b092a0",
"shasum": ""
},
"require": {
"brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13",
"ext-json": "*",
"php": "^8.0",
"ramsey/collection": "^1.2 || ^2.0"
},
@ -3456,9 +3455,9 @@
],
"support": {
"issues": "https://github.com/ramsey/uuid/issues",
"source": "https://github.com/ramsey/uuid/tree/4.8.1"
"source": "https://github.com/ramsey/uuid/tree/4.9.0"
},
"time": "2025-06-01T06:28:46+00:00"
"time": "2025-06-25T14:20:11+00:00"
},
{
"name": "spatie/enum",

2
config/ide-helper.php

@ -118,7 +118,7 @@ return [
*/
'extra' => [
'Eloquent' => [Builder::class, \Illuminate\Database\Query\Builder::class],
'Eloquent' => [Builder::class, Illuminate\Database\Query\Builder::class],
'Session' => [Store::class],
],

2
config/importer.php

@ -24,7 +24,7 @@
declare(strict_types=1);
return [
'version' => 'develop/2025-06-25',
'version' => 'develop/2025-06-26',
'flows' => ['nordigen', 'spectre', 'file', 'simplefin'],
'enabled_flows' => [
'nordigen' => true,

166
package-lock.json

@ -766,9 +766,9 @@
}
},
"node_modules/@rollup/rollup-android-arm-eabi": {
"version": "4.44.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.44.0.tgz",
"integrity": "sha512-xEiEE5oDW6tK4jXCAyliuntGR+amEMO7HLtdSshVuhFnKTYoeYMyXQK7pLouAJJj5KHdwdn87bfHAR2nSdNAUA==",
"version": "4.44.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.44.1.tgz",
"integrity": "sha512-JAcBr1+fgqx20m7Fwe1DxPUl/hPkee6jA6Pl7n1v2EFiktAHenTaXl5aIFjUIEsfn9w3HE4gK1lEgNGMzBDs1w==",
"cpu": [
"arm"
],
@ -780,9 +780,9 @@
]
},
"node_modules/@rollup/rollup-android-arm64": {
"version": "4.44.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.44.0.tgz",
"integrity": "sha512-uNSk/TgvMbskcHxXYHzqwiyBlJ/lGcv8DaUfcnNwict8ba9GTTNxfn3/FAoFZYgkaXXAdrAA+SLyKplyi349Jw==",
"version": "4.44.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.44.1.tgz",
"integrity": "sha512-RurZetXqTu4p+G0ChbnkwBuAtwAbIwJkycw1n6GvlGlBuS4u5qlr5opix8cBAYFJgaY05TWtM+LaoFggUmbZEQ==",
"cpu": [
"arm64"
],
@ -794,9 +794,9 @@
]
},
"node_modules/@rollup/rollup-darwin-arm64": {
"version": "4.44.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.44.0.tgz",
"integrity": "sha512-VGF3wy0Eq1gcEIkSCr8Ke03CWT+Pm2yveKLaDvq51pPpZza3JX/ClxXOCmTYYq3us5MvEuNRTaeyFThCKRQhOA==",
"version": "4.44.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.44.1.tgz",
"integrity": "sha512-fM/xPesi7g2M7chk37LOnmnSTHLG/v2ggWqKj3CCA1rMA4mm5KVBT1fNoswbo1JhPuNNZrVwpTvlCVggv8A2zg==",
"cpu": [
"arm64"
],
@ -808,9 +808,9 @@
]
},
"node_modules/@rollup/rollup-darwin-x64": {
"version": "4.44.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.44.0.tgz",
"integrity": "sha512-fBkyrDhwquRvrTxSGH/qqt3/T0w5Rg0L7ZIDypvBPc1/gzjJle6acCpZ36blwuwcKD/u6oCE/sRWlUAcxLWQbQ==",
"version": "4.44.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.44.1.tgz",
"integrity": "sha512-gDnWk57urJrkrHQ2WVx9TSVTH7lSlU7E3AFqiko+bgjlh78aJ88/3nycMax52VIVjIm3ObXnDL2H00e/xzoipw==",
"cpu": [
"x64"
],
@ -822,9 +822,9 @@
]
},
"node_modules/@rollup/rollup-freebsd-arm64": {
"version": "4.44.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.44.0.tgz",
"integrity": "sha512-u5AZzdQJYJXByB8giQ+r4VyfZP+walV+xHWdaFx/1VxsOn6eWJhK2Vl2eElvDJFKQBo/hcYIBg/jaKS8ZmKeNQ==",
"version": "4.44.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.44.1.tgz",
"integrity": "sha512-wnFQmJ/zPThM5zEGcnDcCJeYJgtSLjh1d//WuHzhf6zT3Md1BvvhJnWoy+HECKu2bMxaIcfWiu3bJgx6z4g2XA==",
"cpu": [
"arm64"
],
@ -836,9 +836,9 @@
]
},
"node_modules/@rollup/rollup-freebsd-x64": {
"version": "4.44.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.44.0.tgz",
"integrity": "sha512-qC0kS48c/s3EtdArkimctY7h3nHicQeEUdjJzYVJYR3ct3kWSafmn6jkNCA8InbUdge6PVx6keqjk5lVGJf99g==",
"version": "4.44.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.44.1.tgz",
"integrity": "sha512-uBmIxoJ4493YATvU2c0upGz87f99e3wop7TJgOA/bXMFd2SvKCI7xkxY/5k50bv7J6dw1SXT4MQBQSLn8Bb/Uw==",
"cpu": [
"x64"
],
@ -850,9 +850,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm-gnueabihf": {
"version": "4.44.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.44.0.tgz",
"integrity": "sha512-x+e/Z9H0RAWckn4V2OZZl6EmV0L2diuX3QB0uM1r6BvhUIv6xBPL5mrAX2E3e8N8rEHVPwFfz/ETUbV4oW9+lQ==",
"version": "4.44.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.44.1.tgz",
"integrity": "sha512-n0edDmSHlXFhrlmTK7XBuwKlG5MbS7yleS1cQ9nn4kIeW+dJH+ExqNgQ0RrFRew8Y+0V/x6C5IjsHrJmiHtkxQ==",
"cpu": [
"arm"
],
@ -864,9 +864,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm-musleabihf": {
"version": "4.44.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.44.0.tgz",
"integrity": "sha512-1exwiBFf4PU/8HvI8s80icyCcnAIB86MCBdst51fwFmH5dyeoWVPVgmQPcKrMtBQ0W5pAs7jBCWuRXgEpRzSCg==",
"version": "4.44.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.44.1.tgz",
"integrity": "sha512-8WVUPy3FtAsKSpyk21kV52HCxB+me6YkbkFHATzC2Yd3yuqHwy2lbFL4alJOLXKljoRw08Zk8/xEj89cLQ/4Nw==",
"cpu": [
"arm"
],
@ -878,9 +878,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm64-gnu": {
"version": "4.44.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.44.0.tgz",
"integrity": "sha512-ZTR2mxBHb4tK4wGf9b8SYg0Y6KQPjGpR4UWwTFdnmjB4qRtoATZ5dWn3KsDwGa5Z2ZBOE7K52L36J9LueKBdOQ==",
"version": "4.44.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.44.1.tgz",
"integrity": "sha512-yuktAOaeOgorWDeFJggjuCkMGeITfqvPgkIXhDqsfKX8J3jGyxdDZgBV/2kj/2DyPaLiX6bPdjJDTu9RB8lUPQ==",
"cpu": [
"arm64"
],
@ -892,9 +892,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm64-musl": {
"version": "4.44.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.44.0.tgz",
"integrity": "sha512-GFWfAhVhWGd4r6UxmnKRTBwP1qmModHtd5gkraeW2G490BpFOZkFtem8yuX2NyafIP/mGpRJgTJ2PwohQkUY/Q==",
"version": "4.44.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.44.1.tgz",
"integrity": "sha512-W+GBM4ifET1Plw8pdVaecwUgxmiH23CfAUj32u8knq0JPFyK4weRy6H7ooxYFD19YxBulL0Ktsflg5XS7+7u9g==",
"cpu": [
"arm64"
],
@ -906,9 +906,9 @@
]
},
"node_modules/@rollup/rollup-linux-loongarch64-gnu": {
"version": "4.44.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.44.0.tgz",
"integrity": "sha512-xw+FTGcov/ejdusVOqKgMGW3c4+AgqrfvzWEVXcNP6zq2ue+lsYUgJ+5Rtn/OTJf7e2CbgTFvzLW2j0YAtj0Gg==",
"version": "4.44.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.44.1.tgz",
"integrity": "sha512-1zqnUEMWp9WrGVuVak6jWTl4fEtrVKfZY7CvcBmUUpxAJ7WcSowPSAWIKa/0o5mBL/Ij50SIf9tuirGx63Ovew==",
"cpu": [
"loong64"
],
@ -920,9 +920,9 @@
]
},
"node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
"version": "4.44.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.44.0.tgz",
"integrity": "sha512-bKGibTr9IdF0zr21kMvkZT4K6NV+jjRnBoVMt2uNMG0BYWm3qOVmYnXKzx7UhwrviKnmK46IKMByMgvpdQlyJQ==",
"version": "4.44.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.44.1.tgz",
"integrity": "sha512-Rl3JKaRu0LHIx7ExBAAnf0JcOQetQffaw34T8vLlg9b1IhzcBgaIdnvEbbsZq9uZp3uAH+JkHd20Nwn0h9zPjA==",
"cpu": [
"ppc64"
],
@ -934,9 +934,9 @@
]
},
"node_modules/@rollup/rollup-linux-riscv64-gnu": {
"version": "4.44.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.44.0.tgz",
"integrity": "sha512-vV3cL48U5kDaKZtXrti12YRa7TyxgKAIDoYdqSIOMOFBXqFj2XbChHAtXquEn2+n78ciFgr4KIqEbydEGPxXgA==",
"version": "4.44.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.44.1.tgz",
"integrity": "sha512-j5akelU3snyL6K3N/iX7otLBIl347fGwmd95U5gS/7z6T4ftK288jKq3A5lcFKcx7wwzb5rgNvAg3ZbV4BqUSw==",
"cpu": [
"riscv64"
],
@ -948,9 +948,9 @@
]
},
"node_modules/@rollup/rollup-linux-riscv64-musl": {
"version": "4.44.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.44.0.tgz",
"integrity": "sha512-TDKO8KlHJuvTEdfw5YYFBjhFts2TR0VpZsnLLSYmB7AaohJhM8ctDSdDnUGq77hUh4m/djRafw+9zQpkOanE2Q==",
"version": "4.44.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.44.1.tgz",
"integrity": "sha512-ppn5llVGgrZw7yxbIm8TTvtj1EoPgYUAbfw0uDjIOzzoqlZlZrLJ/KuiE7uf5EpTpCTrNt1EdtzF0naMm0wGYg==",
"cpu": [
"riscv64"
],
@ -962,9 +962,9 @@
]
},
"node_modules/@rollup/rollup-linux-s390x-gnu": {
"version": "4.44.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.44.0.tgz",
"integrity": "sha512-8541GEyktXaw4lvnGp9m84KENcxInhAt6vPWJ9RodsB/iGjHoMB2Pp5MVBCiKIRxrxzJhGCxmNzdu+oDQ7kwRA==",
"version": "4.44.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.44.1.tgz",
"integrity": "sha512-Hu6hEdix0oxtUma99jSP7xbvjkUM/ycke/AQQ4EC5g7jNRLLIwjcNwaUy95ZKBJJwg1ZowsclNnjYqzN4zwkAw==",
"cpu": [
"s390x"
],
@ -976,9 +976,9 @@
]
},
"node_modules/@rollup/rollup-linux-x64-gnu": {
"version": "4.44.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.44.0.tgz",
"integrity": "sha512-iUVJc3c0o8l9Sa/qlDL2Z9UP92UZZW1+EmQ4xfjTc1akr0iUFZNfxrXJ/R1T90h/ILm9iXEY6+iPrmYB3pXKjw==",
"version": "4.44.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.44.1.tgz",
"integrity": "sha512-EtnsrmZGomz9WxK1bR5079zee3+7a+AdFlghyd6VbAjgRJDbTANJ9dcPIPAi76uG05micpEL+gPGmAKYTschQw==",
"cpu": [
"x64"
],
@ -990,9 +990,9 @@
]
},
"node_modules/@rollup/rollup-linux-x64-musl": {
"version": "4.44.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.44.0.tgz",
"integrity": "sha512-PQUobbhLTQT5yz/SPg116VJBgz+XOtXt8D1ck+sfJJhuEsMj2jSej5yTdp8CvWBSceu+WW+ibVL6dm0ptG5fcA==",
"version": "4.44.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.44.1.tgz",
"integrity": "sha512-iAS4p+J1az6Usn0f8xhgL4PaU878KEtutP4hqw52I4IO6AGoyOkHCxcc4bqufv1tQLdDWFx8lR9YlwxKuv3/3g==",
"cpu": [
"x64"
],
@ -1004,9 +1004,9 @@
]
},
"node_modules/@rollup/rollup-win32-arm64-msvc": {
"version": "4.44.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.44.0.tgz",
"integrity": "sha512-M0CpcHf8TWn+4oTxJfh7LQuTuaYeXGbk0eageVjQCKzYLsajWS/lFC94qlRqOlyC2KvRT90ZrfXULYmukeIy7w==",
"version": "4.44.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.44.1.tgz",
"integrity": "sha512-NtSJVKcXwcqozOl+FwI41OH3OApDyLk3kqTJgx8+gp6On9ZEt5mYhIsKNPGuaZr3p9T6NWPKGU/03Vw4CNU9qg==",
"cpu": [
"arm64"
],
@ -1018,9 +1018,9 @@
]
},
"node_modules/@rollup/rollup-win32-ia32-msvc": {
"version": "4.44.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.44.0.tgz",
"integrity": "sha512-3XJ0NQtMAXTWFW8FqZKcw3gOQwBtVWP/u8TpHP3CRPXD7Pd6s8lLdH3sHWh8vqKCyyiI8xW5ltJScQmBU9j7WA==",
"version": "4.44.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.44.1.tgz",
"integrity": "sha512-JYA3qvCOLXSsnTR3oiyGws1Dm0YTuxAAeaYGVlGpUsHqloPcFjPg+X0Fj2qODGLNwQOAcCiQmHub/V007kiH5A==",
"cpu": [
"ia32"
],
@ -1032,9 +1032,9 @@
]
},
"node_modules/@rollup/rollup-win32-x64-msvc": {
"version": "4.44.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.44.0.tgz",
"integrity": "sha512-Q2Mgwt+D8hd5FIPUuPDsvPR7Bguza6yTkJxspDGkZj7tBRn2y4KSWYuIXpftFSjBra76TbKerCV7rgFPQrn+wQ==",
"version": "4.44.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.44.1.tgz",
"integrity": "sha512-J8o22LuF0kTe7m+8PvW9wk3/bRq5+mRo5Dqo6+vXb7otCm3TPhYOJqOaQtGU9YMWQSL3krMnoOxMr0+9E6F3Ug==",
"cpu": [
"x64"
],
@ -1680,9 +1680,9 @@
}
},
"node_modules/rollup": {
"version": "4.44.0",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.44.0.tgz",
"integrity": "sha512-qHcdEzLCiktQIfwBq420pn2dP+30uzqYxv9ETm91wdt2R9AFcWfjNAmje4NWlnCIQ5RMTzVf0ZyisOKqHR6RwA==",
"version": "4.44.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.44.1.tgz",
"integrity": "sha512-x8H8aPvD+xbl0Do8oez5f5o8eMS3trfCghc4HhLAnCkj7Vl0d1JWGs0UF/D886zLW2rOj2QymV/JcSSsw+XDNg==",
"dev": true,
"license": "MIT",
"dependencies": {
@ -1696,26 +1696,26 @@
"npm": ">=8.0.0"
},
"optionalDependencies": {
"@rollup/rollup-android-arm-eabi": "4.44.0",
"@rollup/rollup-android-arm64": "4.44.0",
"@rollup/rollup-darwin-arm64": "4.44.0",
"@rollup/rollup-darwin-x64": "4.44.0",
"@rollup/rollup-freebsd-arm64": "4.44.0",
"@rollup/rollup-freebsd-x64": "4.44.0",
"@rollup/rollup-linux-arm-gnueabihf": "4.44.0",
"@rollup/rollup-linux-arm-musleabihf": "4.44.0",
"@rollup/rollup-linux-arm64-gnu": "4.44.0",
"@rollup/rollup-linux-arm64-musl": "4.44.0",
"@rollup/rollup-linux-loongarch64-gnu": "4.44.0",
"@rollup/rollup-linux-powerpc64le-gnu": "4.44.0",
"@rollup/rollup-linux-riscv64-gnu": "4.44.0",
"@rollup/rollup-linux-riscv64-musl": "4.44.0",
"@rollup/rollup-linux-s390x-gnu": "4.44.0",
"@rollup/rollup-linux-x64-gnu": "4.44.0",
"@rollup/rollup-linux-x64-musl": "4.44.0",
"@rollup/rollup-win32-arm64-msvc": "4.44.0",
"@rollup/rollup-win32-ia32-msvc": "4.44.0",
"@rollup/rollup-win32-x64-msvc": "4.44.0",
"@rollup/rollup-android-arm-eabi": "4.44.1",
"@rollup/rollup-android-arm64": "4.44.1",
"@rollup/rollup-darwin-arm64": "4.44.1",
"@rollup/rollup-darwin-x64": "4.44.1",
"@rollup/rollup-freebsd-arm64": "4.44.1",
"@rollup/rollup-freebsd-x64": "4.44.1",
"@rollup/rollup-linux-arm-gnueabihf": "4.44.1",
"@rollup/rollup-linux-arm-musleabihf": "4.44.1",
"@rollup/rollup-linux-arm64-gnu": "4.44.1",
"@rollup/rollup-linux-arm64-musl": "4.44.1",
"@rollup/rollup-linux-loongarch64-gnu": "4.44.1",
"@rollup/rollup-linux-powerpc64le-gnu": "4.44.1",
"@rollup/rollup-linux-riscv64-gnu": "4.44.1",
"@rollup/rollup-linux-riscv64-musl": "4.44.1",
"@rollup/rollup-linux-s390x-gnu": "4.44.1",
"@rollup/rollup-linux-x64-gnu": "4.44.1",
"@rollup/rollup-linux-x64-musl": "4.44.1",
"@rollup/rollup-win32-arm64-msvc": "4.44.1",
"@rollup/rollup-win32-ia32-msvc": "4.44.1",
"@rollup/rollup-win32-x64-msvc": "4.44.1",
"fsevents": "~2.3.2"
}
},

2
routes/api.php

@ -38,5 +38,5 @@ use Illuminate\Http\Request;
Route::middleware('auth:api')->get(
'/user',
fn(Request $request) => $request->user()
fn (Request $request) => $request->user()
);

2
routes/channels.php

@ -36,5 +36,5 @@ declare(strict_types=1);
Broadcast::channel(
'App.User.{id}',
fn($user, $id) => (int)$user->id === (int)$id
fn ($user, $id) => (int)$user->id === (int)$id
);
Loading…
Cancel
Save