Skip to content

Firefly III: a personal finances manager

🤖 Auto commit for release 'develop' on 2026-02-21

JC5018f68b789cc
diff --git a/.ci/php-cs-fixer/composer.lock b/.ci/php-cs-fixer/composer.lock
index c4ec1072ec..dfee1c5ff1 100644
--- a/.ci/php-cs-fixer/composer.lock
+++ b/.ci/php-cs-fixer/composer.lock
@@ -2687,8 +2687,5 @@
"php": ">=8.5.0"
},
"platform-dev": {},
- "platform-overrides": {
- "php": "8.5"
- },
"plugin-api-version": "2.9.0"
}
diff --git a/app/Console/Commands/Tools/ChecksForUpdates.php b/app/Console/Commands/Tools/ChecksForUpdates.php
index 021bb6d8e1..218af2b64e 100644
--- a/app/Console/Commands/Tools/ChecksForUpdates.php
+++ b/app/Console/Commands/Tools/ChecksForUpdates.php
@@ -1,4 +1,7 @@
<?php
+
+declare(strict_types=1);
+
/*
* ChecksForUpdates.php
* Copyright (c) 2026 [email protected]
@@ -36,7 +39,7 @@ class ChecksForUpdates extends Command
*
* @var string
*/
- protected $signature = 'firefly-iii:check-for-updates {--force}';
+ protected $signature = 'firefly-iii:check-for-updates {--force}';
/**
* The console command description.
@@ -50,13 +53,14 @@ class ChecksForUpdates extends Command
*/
public function handle(): int
{
- $build = Carbon::createFromTimestamp(config('firefly.build_time'), config('app.timezone'));
- $version = config('firefly.version');
+ $build = Carbon::createFromTimestamp(config('firefly.build_time'), config('app.timezone'));
+ $version = config('firefly.version');
$this->friendlyLine(sprintf('You are running version "%s", built on %s', $version, $build->format('Y-m-d H:i')));
$permission = FireflyConfig::get('permission_update_check', -1)->data;
if (1 !== $permission && false === $this->option('force')) {
$this->friendlyWarning('Checking for updates is disabled. To overrule, use --force.');
+
return Command::SUCCESS;
}
if (str_contains(config('firefly.version'), 'develop')) {
@@ -64,24 +68,32 @@ class ChecksForUpdates extends Command
}
/** @var UpdateRequestInterface $request */
- $request = app(UpdateRequestInterface::class);
+ $request = app(UpdateRequestInterface::class);
// stable, alpha or beta
- $info = $request->getUpdateInformation($version, $build, 'stable');
+ $info = $request->getUpdateInformation($version, $build, 'stable');
if ('' !== $info->getError()) {
$this->friendlyError($info->getError());
+
return Command::FAILURE;
}
if (!$info->isNewVersionAvailable()) {
$this->friendlyInfo(trans('firefly.no_new_release_available'));
+
return Command::SUCCESS;
}
// if running develop, slightly different message.
if (str_contains($version, 'develop')) {
- $this->friendlyInfo(trans('firefly.update_current_dev_older', ['version' => $version, 'new_version' => $info->getNewVersion()]));
+ $this->friendlyInfo(trans('firefly.update_current_dev_older', ['version' => $version, 'new_version' => $info->getNewVersion()]));
+
return Command::SUCCESS;
}
- $this->friendlyInfo(trans('firefly.update_new_version_alert', ['your_version' => $version, 'new_version' => $info->getNewVersion(), 'date' => $info->getPublishedAt()->format('Y-m-d H:i:s')]));
+ $this->friendlyInfo(trans('firefly.update_new_version_alert', [
+ 'your_version' => $version,
+ 'new_version' => $info->getNewVersion(),
+ 'date' => $info->getPublishedAt()->format('Y-m-d H:i:s'),
+ ]));
+
return Command::SUCCESS;
}
}
diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.php
index 23a6214dbb..94bb51c858 100644
--- a/app/Helpers/Collector/GroupCollector.php
+++ b/app/Helpers/Collector/GroupCollector.php
@@ -1142,7 +1142,6 @@ class GroupCollector implements GroupCollectorInterface
->orderBy('transaction_journals.order', 'ASC')
->orderBy('transaction_journals.id', 'DESC')
->orderBy('transaction_journals.description', 'DESC')
- ->orderBy('source.amount', 'DESC')
- ;
+ ->orderBy('source.amount', 'DESC');
}
}
diff --git a/app/Helpers/Update/UpdateTrait.php b/app/Helpers/Update/UpdateTrait.php
index 91aaa47c8a..58dd6ac0bd 100644
--- a/app/Helpers/Update/UpdateTrait.php
+++ b/app/Helpers/Update/UpdateTrait.php
@@ -47,7 +47,7 @@ trait UpdateTrait
/** @var UpdateRequestInterface $checker */
$checker = app(UpdateRequestInterface::class);
$channelConfig = FireflyConfig::get('update_channel', 'stable');
- $channel = (string)$channelConfig->data;
+ $channel = (string) $channelConfig->data;
$build = Carbon::createFromTimestamp(config('firefly.build_time'), config('app.timezone'));
$version = config('firefly.version');
diff --git a/app/Http/Controllers/Admin/UpdateController.php b/app/Http/Controllers/Admin/UpdateController.php
index 4cd485d462..7f748825ec 100644
--- a/app/Http/Controllers/Admin/UpdateController.php
+++ b/app/Http/Controllers/Admin/UpdateController.php
@@ -48,7 +48,7 @@ class UpdateController extends Controller
{
parent::__construct();
$this->middleware(static function ($request, $next) {
- app('view')->share('title', (string)trans('firefly.system_settings'));
+ app('view')->share('title', (string) trans('firefly.system_settings'));
app('view')->share('mainTitleIcon', 'fa-hand-spock-o');
return $next($request);
@@ -61,24 +61,24 @@ class UpdateController extends Controller
*
* @return Factory|View
*/
- public function index(): Factory | \Illuminate\Contracts\View\View
+ public function index(): Factory|\Illuminate\Contracts\View\View
{
- $subTitle = (string)trans('firefly.update_check_title');
+ $subTitle = (string) trans('firefly.update_check_title');
$subTitleIcon = 'fa-star';
$permission = FireflyConfig::get('permission_update_check', -1);
$channel = FireflyConfig::get('update_channel', 'stable');
$selected = $permission->data;
$channelSelected = $channel->data;
$options = [
- -1 => (string)trans('firefly.updates_ask_me_later'),
- 0 => (string)trans('firefly.updates_do_not_check'),
- 1 => (string)trans('firefly.updates_enable_check'),
+ -1 => (string) trans('firefly.updates_ask_me_later'),
+ 0 => (string) trans('firefly.updates_do_not_check'),
+ 1 => (string) trans('firefly.updates_enable_check'),
];
- $channelOptions = [
- 'stable' => (string)trans('firefly.update_channel_stable'),
- 'beta' => (string)trans('firefly.update_channel_beta'),
- 'alpha' => (string)trans('firefly.update_channel_alpha'),
+ $channelOptions = [
+ 'stable' => (string) trans('firefly.update_channel_stable'),
+ 'beta' => (string) trans('firefly.update_channel_beta'),
+ 'alpha' => (string) trans('firefly.update_channel_alpha'),
];
return view('settings.update.index', [
@@ -94,16 +94,16 @@ class UpdateController extends Controller
/**
* Post new settings.
*/
- public function post(Request $request): Redirector | RedirectResponse
+ public function post(Request $request): Redirector|RedirectResponse
{
- $checkForUpdates = (int)$request->get('check_for_updates');
+ $checkForUpdates = (int) $request->get('check_for_updates');
$channel = $request->get('update_channel');
$channel = in_array($channel, ['stable', 'beta', 'alpha'], true) ? $channel : 'stable';
FireflyConfig::set('permission_update_check', $checkForUpdates);
FireflyConfig::set('last_update_check', Carbon::now()->getTimestamp());
FireflyConfig::set('update_channel', $channel);
- session()->flash('success', (string)trans('firefly.configuration_updated'));
+ session()->flash('success', (string) trans('firefly.configuration_updated'));
return redirect(route('settings.update-check'));
}
@@ -123,10 +123,14 @@ class UpdateController extends Controller
if ($release->isNewVersionAvailable()) {
// if running develop, slightly different message.
if (str_contains(config('firefly.version'), 'develop')) {
- $message = trans('firefly.update_current_dev_older', ['version' => config('firefly.version'), 'new_version' => $release->getNewVersion()]);
+ $message = trans('firefly.update_current_dev_older', ['version' => config('firefly.version'), 'new_version' => $release->getNewVersion()]);
}
if (!str_contains(config('firefly.version'), 'develop')) {
- $message = trans('firefly.update_new_version_alert', ['your_version' => config('firefly.version'), 'new_version' => $release->getNewVersion(), 'date' => $release->getPublishedAt()->format('Y-m-d H:i:s')]);
+ $message = trans('firefly.update_new_version_alert', [
+ 'your_version' => config('firefly.version'),
+ 'new_version' => $release->getNewVersion(),
+ 'date' => $release->getPublishedAt()->format('Y-m-d H:i:s'),
+ ]);
}
}
diff --git a/app/Listeners/Security/System/ChecksForNewVersion.php b/app/Listeners/Security/System/ChecksForNewVersion.php
index 8eccc1ce13..ab55cb330f 100644
--- a/app/Listeners/Security/System/ChecksForNewVersion.php
+++ b/app/Listeners/Security/System/ChecksForNewVersion.php
@@ -45,8 +45,8 @@ class ChecksForNewVersion implements ShouldQueue
Log::debug(sprintf('Now in %s', __METHOD__));
// should not check for updates:
- $permission = FireflyConfig::get('permission_update_check', -1);
- $value = (int)$permission->data;
+ $permission = FireflyConfig::get('permission_update_check', -1);
+ $value = (int) $permission->data;
if (1 !== $value) {
Log::debug('Update check is not enabled.');
$this->warnToCheckForUpdates($event);
@@ -55,8 +55,8 @@ class ChecksForNewVersion implements ShouldQueue
}
/** @var UserRepositoryInterface $repository */
- $repository = app(UserRepositoryInterface::class);
- $user = $event->user;
+ $repository = app(UserRepositoryInterface::class);
+ $user = $event->user;
if (!$repository->hasRole($user, 'owner')) {
Log::debug('User is not admin, done.');
@@ -75,9 +75,9 @@ class ChecksForNewVersion implements ShouldQueue
}
// last check time was more than a week ago.
Log::debug('Have not checked for a new version in a week!');
- $release = $this->getLatestRelease();
- $level = 'info';
- $message = trans('firefly.no_new_release_available');
+ $release = $this->getLatestRelease();
+ $level = 'info';
+ $message = trans('firefly.no_new_release_available');
if ('' !== $release->getError()) {
$level = 'error';
$message = $release->getError();
@@ -85,10 +85,14 @@ class ChecksForNewVersion implements ShouldQueue
if ($release->isNewVersionAvailable()) {
// if running develop, slightly different message.
if (str_contains(config('firefly.version'), 'develop')) {
- $message = trans('firefly.update_current_dev_older', ['version' => config('firefly.version'), 'new_version' => $release->getNewVersion()]);
+ $message = trans('firefly.update_current_dev_older', ['version' => config('firefly.version'), 'new_version' => $release->getNewVersion()]);
}
if (!str_contains(config('firefly.version'), 'develop')) {
- $message = trans('firefly.update_new_version_alert', ['your_version' => config('firefly.version'), 'new_version' => $release->getNewVersion(), 'date' => $release->getPublishedAt()->format('Y-m-d H:i:s')]);
+ $message = trans('firefly.update_new_version_alert', [
+ 'your_version' => config('firefly.version'),
+ 'new_version' => $release->getNewVersion(),
+ 'date' => $release->getPublishedAt()->format('Y-m-d H:i:s'),
+ ]);
}
}
@@ -104,8 +108,8 @@ class ChecksForNewVersion implements ShouldQueue
private function warnToCheckForUpdates(SystemRequestedVersionCheck $event): void
{
/** @var UserRepositoryInterface $repository */
- $repository = app(UserRepositoryInterface::class);
- $user = $event->user;
+ $repository = app(UserRepositoryInterface::class);
+ $user = $event->user;
if (!$repository->hasRole($user, 'owner')) {
Log::debug('User is not admin, done.');
@@ -119,16 +123,16 @@ class ChecksForNewVersion implements ShouldQueue
Log::debug(sprintf('Last warning time is %d, current time is %d, difference is %d', $lastCheckTime->data, $now, $diff));
if ($diff < (604800 * 4)) {
Log::debug(sprintf(
- 'Warned about updates less than four weeks ago (on %s).',
- Carbon::createFromTimestamp($lastCheckTime->data)->format('Y-m-d H:i:s')
- ));
+ 'Warned about updates less than four weeks ago (on %s).',
+ Carbon::createFromTimestamp($lastCheckTime->data)->format('Y-m-d H:i:s')
+ ));
return;
}
// last check time was more than a week ago.
Log::debug('Have warned about a new version in four weeks!');
- session()->flash('info', (string)trans('firefly.disabled_but_check'));
+ session()->flash('info', (string) trans('firefly.disabled_but_check'));
FireflyConfig::set('last_update_warning', Carbon::now()->getTimestamp());
}
}
diff --git a/app/Models/AccountType.php b/app/Models/AccountType.php
index 740f76c775..bc8cefa84d 100644
--- a/app/Models/AccountType.php
+++ b/app/Models/AccountType.php
@@ -23,7 +23,6 @@ declare(strict_types=1);
namespace FireflyIII\Models;
-use Deprecated;
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
@@ -32,9 +31,9 @@ class AccountType extends Model
{
use ReturnsIntegerIdTrait;
- protected $casts = ['created_at' => 'datetime', 'updated_at' => 'datetime'];
+ protected $casts = ['created_at' => 'datetime', 'updated_at' => 'datetime'];
- protected $fillable = ['type'];
+ protected $fillable = ['type'];
public function accounts(): HasMany
{
diff --git a/app/Models/AutoBudget.php b/app/Models/AutoBudget.php
index 197384d6ba..fa97b9691d 100644
--- a/app/Models/AutoBudget.php
+++ b/app/Models/AutoBudget.php
@@ -24,7 +24,6 @@ declare(strict_types=1);
namespace FireflyIII\Models;
-use Deprecated;
use FireflyIII\Handlers\Observer\AutoBudgetObserver;
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
@@ -39,8 +38,8 @@ class AutoBudget extends Model
use ReturnsIntegerIdTrait;
use SoftDeletes;
- protected $casts = ['amount' => 'string', 'native_amount' => 'string'];
- protected $fillable = ['budget_id', 'amount', 'period', 'native_amount'];
+ protected $casts = ['amount' => 'string', 'native_amount' => 'string'];
+ protected $fillable = ['budget_id', 'amount', 'period', 'native_amount'];
public function budget(): BelongsTo
{
diff --git a/app/Models/RecurrenceRepetition.php b/app/Models/RecurrenceRepetition.php
index 4fe8074c66..746fe6e13d 100644
--- a/app/Models/RecurrenceRepetition.php
+++ b/app/Models/RecurrenceRepetition.php
@@ -24,7 +24,6 @@ declare(strict_types=1);
namespace FireflyIII\Models;
-use Deprecated;
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
@@ -36,7 +35,7 @@ class RecurrenceRepetition extends Model
use ReturnsIntegerIdTrait;
use SoftDeletes;
- protected $casts = [
+ protected $casts = [
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
@@ -46,9 +45,9 @@ class RecurrenceRepetition extends Model
'weekend' => 'int',
];
- protected $fillable = ['recurrence_id', 'weekend', 'repetition_type', 'repetition_moment', 'repetition_skip'];
+ protected $fillable = ['recurrence_id', 'weekend', 'repetition_type', 'repetition_moment', 'repetition_skip'];
- protected $table = 'recurrences_repetitions';
+ protected $table = 'recurrences_repetitions';
public function recurrence(): BelongsTo
{
diff --git a/app/Models/Transaction.php b/app/Models/Transaction.php
index 27fc1cb6ea..2f887ae958 100644
--- a/app/Models/Transaction.php
+++ b/app/Models/Transaction.php
@@ -30,7 +30,6 @@ use Illuminate\Database\Eloquent\Attributes\ObservedBy;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Casts\Attribute;
-use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php
index 56fa76feb7..95d8d5998e 100644
--- a/app/Models/TransactionJournal.php
+++ b/app/Models/TransactionJournal.php
@@ -34,7 +34,6 @@ use Illuminate\Database\Eloquent\Attributes\ObservedBy;
use Illuminate\Database\Eloquent\Attributes\Scope;
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Eloquent\Casts\Attribute;
-use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
diff --git a/app/Models/TransactionType.php b/app/Models/TransactionType.php
index 2f3f1e3bf8..cfb4a4656b 100644
--- a/app/Models/TransactionType.php
+++ b/app/Models/TransactionType.php
@@ -23,7 +23,6 @@ declare(strict_types=1);
namespace FireflyIII\Models;
-use Deprecated;
use FireflyIII\Enums\TransactionTypeEnum;
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
use Illuminate\Database\Eloquent\Model;
@@ -36,8 +35,8 @@ class TransactionType extends Model
use ReturnsIntegerIdTrait;
use SoftDeletes;
- protected $casts = ['created_at' => 'datetime', 'updated_at' => 'datetime', 'deleted_at' => 'datetime'];
- protected $fillable = ['type'];
+ protected $casts = ['created_at' => 'datetime', 'updated_at' => 'datetime', 'deleted_at' => 'datetime'];
+ protected $fillable = ['type'];
/**
* Route binder. Converts the key in the URL to the specified object (or throw 404).
diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.php
index fafcce5bfb..fe376618f0 100644
--- a/app/Providers/FireflyServiceProvider.php
+++ b/app/Providers/FireflyServiceProvider.php
@@ -192,7 +192,7 @@ class FireflyServiceProvider extends ServiceProvider
$this->app->bind(PopupReportInterface::class, PopupReport::class);
$this->app->bind(ReportHelperInterface::class, ReportHelper::class);
$this->app->bind(FiscalHelperInterface::class, FiscalHelper::class);
- //$this->app->bind(UpdateRequestInterface::class, UpdateRequest::class);
+ // $this->app->bind(UpdateRequestInterface::class, UpdateRequest::class);
$this->app->bind(UpdateRequestInterface::class, GitHubUpdateRequest::class);
// webhooks:
diff --git a/app/Providers/FireflySessionProvider.php b/app/Providers/FireflySessionProvider.php
index 9bdcbf98e4..81789aa918 100644
--- a/app/Providers/FireflySessionProvider.php
+++ b/app/Providers/FireflySessionProvider.php
@@ -51,9 +51,7 @@ class FireflySessionProvider extends ServiceProvider
*/
protected function registerSessionDriver(): void
{
- $this->app->singleton(
- 'session.store',
- static fn ($app)
+ $this->app->singleton('session.store', static fn ($app)
// First, we will create the session manager which is responsible for the
// creation of the various session drivers when they are needed by the
// application instance, and will resolve them on a lazy load basis.
diff --git a/app/Services/FireflyIIIOrg/Update/GitHubUpdateRequest.php b/app/Services/FireflyIIIOrg/Update/GitHubUpdateRequest.php
index 5b6ebcbc20..ff212ba3a9 100644
--- a/app/Services/FireflyIIIOrg/Update/GitHubUpdateRequest.php
+++ b/app/Services/FireflyIIIOrg/Update/GitHubUpdateRequest.php
@@ -1,4 +1,7 @@
<?php
+
+declare(strict_types=1);
+
/*
* GitHubUpdateRequest.php
* Copyright (c) 2026 [email protected]
@@ -25,6 +28,7 @@ use Carbon\Carbon;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\ClientException;
use Illuminate\Support\Facades\Log;
+use Override;
class GitHubUpdateRequest implements UpdateRequestInterface
{
@@ -33,7 +37,7 @@ class GitHubUpdateRequest implements UpdateRequestInterface
private string $channel = 'stable';
private bool $localDebug = false;
- #[\Override]
+ #[Override]
public function getUpdateInformation(string $currentVersion, Carbon $currentBuild, string $channel): UpdateResponse
{
$this->currentVersion = $currentVersion;
@@ -41,18 +45,19 @@ class GitHubUpdateRequest implements UpdateRequestInterface
$this->currentBuild = $currentBuild;
Log::debug(sprintf('Now in getUpdateInformation(%s, %s)', $currentVersion, $channel));
- $response = new UpdateResponse();
- $releases = $this->getReleases();
- $filtered = $this->filterReleases($releases);
+ $response = new UpdateResponse();
+ $releases = $this->getReleases();
+ $filtered = $this->filterReleases($releases);
Log::debug(sprintf('Left with %d release(s) to compare', count($filtered)));
if (0 === count($filtered)) {
$response->setNewVersionAvailable(false);
+
return $response;
}
- $newest = $this->getNewest($filtered);
+ $newest = $this->getNewest($filtered);
Log::debug(sprintf('Newest release is "%s" released on %s', $newest['version'], $newest['published_at']->format('Y-m-d H:i')));
@@ -64,26 +69,39 @@ class GitHubUpdateRequest implements UpdateRequestInterface
if (str_contains($currentVersion, 'develop')) {
Log::debug(sprintf('Compare with current version "%s", built on %s', $currentVersion, $currentBuild->format('Y-m-d H:i')));
if ($currentBuild->gt($newest['published_at'])) {
- Log::debug(sprintf('Current build %s is older than newest build %s, so a new release is available.', $currentBuild->format('Y-m-d H:i'), $newest['published_at']->format('Y-m-d H:i')));
+ Log::debug(sprintf(
+ 'Current build %s is older than newest build %s, so a new release is available.',
+ $currentBuild->format('Y-m-d H:i'),
+ $newest['published_at']->format('Y-m-d H:i')
+ ));
$response->setNewVersionAvailable(true);
+
return $response;
}
if ($currentBuild->lt($newest['published_at'])) {
- Log::debug(sprintf('Current build %s is newer than newest build %s, so NO new release is available.', $currentBuild->format('Y-m-d H:i'), $newest['published_at']->format('Y-m-d H:i')));
+ Log::debug(sprintf(
+ 'Current build %s is newer than newest build %s, so NO new release is available.',
+ $currentBuild->format('Y-m-d H:i'),
+ $newest['published_at']->format('Y-m-d H:i')
+ ));
$response->setNewVersionAvailable(false);
+
return $response;
}
+
return $response;
}
// if not, compare version.
- $res = version_compare($newest['version'], $currentVersion);
+ $res = version_compare($newest['version'], $currentVersion);
if ($res < 1) {
$response->setNewVersionAvailable(false);
+
return $response;
}
if (1 === $res) {
$response->setNewVersionAvailable(true);
+
return $response;
}
@@ -93,41 +111,47 @@ class GitHubUpdateRequest implements UpdateRequestInterface
private function filterReleases(array $releases): array
{
$return = [];
+
/** @var array $release */
foreach ($releases as $release) {
if ($release['published_at']->lte($this->currentBuild)) {
Log::debug(sprintf('Skip older version "%s"', $release['version']));
+
continue;
}
// if channel is stable, and version is "alpha", continue.
// if channel is stable, and version is "beta", continue.
// if channel is beta, and version is "alpha", continue.
- if (($this->channel === 'stable' || $this->channel === 'beta') && str_contains($release['version'], 'alpha')) {
+ if (('stable' === $this->channel || 'beta' === $this->channel) && str_contains($release['version'], 'alpha')) {
Log::debug(sprintf('Skip version "%s"', $release['version']));
+
continue;
}
- if ($this->channel === 'stable' && str_contains($release['version'], 'beta')) {
+ if ('stable' === $this->channel && str_contains($release['version'], 'beta')) {
Log::debug(sprintf('Skip version "%s"', $release['version']));
+
continue;
}
$return[] = $release;
}
+
return $return;
}
private function getNewest(array $releases): array
{
- $latest = [
- 'version' => '1.0.0',
- 'published_at' => now()->startOfYear(),
- ];
+ $latest = ['version' => '1.0.0', 'published_at' => now()->startOfYear()];
foreach ($releases as $release) {
Log::debug(sprintf('Comparing current version "%s" with latest version "%s"', $release['version'], $latest['version']));
if (str_contains($release['version'], 'develop') || str_contains($latest['version'], 'develop')) {
Log::debug('Compare based on build time.');
// compare build times.
if ($latest['published_at']->lt($release['published_at'])) {
- Log::debug(sprintf('Current date "%s" is newer than latest date "%s"', $release['published_at']->format('Y-m-d H:i'), $latest['published_at']->format('Y-m-d H:i')));
+ Log::debug(sprintf(
+ 'Current date "%s" is newer than latest date "%s"',
+ $release['published_at']->format('Y-m-d H:i'),
+ $latest['published_at']->format('Y-m-d H:i')
+ ));
$latest = $release;
}
}
@@ -142,39 +166,38 @@ class GitHubUpdateRequest implements UpdateRequestInterface
}
}
Log::debug(sprintf('Latest version seems to be "%s", released at %s', $latest['version'], $latest['published_at']->format('Y-m-d H:i')));
+
return $latest;
}
private function getReleases(): array
{
$client = new Client();
- $opts = [
- 'headers' => [
- 'User-Agent' => 'FireflyIII/' . config('firefly.version'),
- ],
- ];
+ $opts = ['headers' => ['User-Agent' => 'FireflyIII/'.config('firefly.version')]];
$return = [];
$body = '';
if ($this->localDebug && file_exists('json.json')) {
$body = file_get_contents('json.json');
}
if (!$this->localDebug) {
-
try {
$res = $client->get('https://api.github.com/repos/firefly-iii/firefly-iii/releases', $opts);
} catch (ClientException $e) {
Log::error($e->getMessage());
+
return [];
}
Log::debug('Successfully contacted GitHub');
- $body = (string)$res->getBody();
+ $body = (string) $res->getBody();
}
if (!json_validate($body)) {
Log::debug('GitHub returned invalid JSON');
+
return [];
}
- $json = json_decode($body, true);
+ $json = json_decode($body, true);
+
/** @var array $release */
foreach ($json as $release) {
$version = $release['tag_name'];
@@ -184,13 +207,11 @@ class GitHubUpdateRequest implements UpdateRequestInterface
// always skip "develop" releases, unless user is also running develop.
if (str_contains($version, 'develop') && !str_contains($this->currentVersion, 'develop')) {
Log::debug(sprintf('Skip version "%s"', $release['tag_name']));
+
continue;
}
- $return[] = [
- 'version' => $version,
- 'published_at' => $published,
- ];
+ $return[] = ['version' => $version, 'published_at' => $published];
}
return $return;
diff --git a/app/Services/FireflyIIIOrg/Update/UpdateResponse.php b/app/Services/FireflyIIIOrg/Update/UpdateResponse.php
index 3590921574..1f6c3b88c4 100644
--- a/app/Services/FireflyIIIOrg/Update/UpdateResponse.php
+++ b/app/Services/FireflyIIIOrg/Update/UpdateResponse.php
@@ -1,4 +1,7 @@
<?php
+
+declare(strict_types=1);
+
/*
* UpdateResponse.php
* Copyright (c) 2026 [email protected]
@@ -30,30 +33,29 @@ class UpdateResponse
private string $newVersion = '1.0.0';
private Carbon $publishedAt;
- public function getPublishedAt(): Carbon
+ public function getError(): string
{
- return $this->publishedAt;
+ return $this->error;
}
- public function setPublishedAt(Carbon $publishedAt): void
+ public function getNewVersion(): string
{
- $this->publishedAt = $publishedAt;
+ return $this->newVersion;
}
-
- public function isNewVersionAvailable(): bool
+ public function getPublishedAt(): Carbon
{
- return $this->newVersionAvailable;
+ return $this->publishedAt;
}
- public function setNewVersionAvailable(bool $newVersionAvailable): void
+ public function isNewVersionAvailable(): bool
{
- $this->newVersionAvailable = $newVersionAvailable;
+ return $this->newVersionAvailable;
}
- public function getNewVersion(): string
+ public function setError(string $error): void
{
- return $this->newVersion;
+ $this->error = $error;
}
public function setNewVersion(string $newVersion): void
@@ -61,15 +63,13 @@ class UpdateResponse
$this->newVersion = $newVersion;
}
- public function getError(): string
+ public function setNewVersionAvailable(bool $newVersionAvailable): void
{
- return $this->error;
+ $this->newVersionAvailable = $newVersionAvailable;
}
- public function setError(string $error): void
+ public function setPublishedAt(Carbon $publishedAt): void
{
- $this->error = $error;
+ $this->publishedAt = $publishedAt;
}
-
-
}
diff --git a/app/Support/Cronjobs/UpdateCheckCronjob.php b/app/Support/Cronjobs/UpdateCheckCronjob.php
index b3f34d3fc0..b234ac62cf 100644
--- a/app/Support/Cronjobs/UpdateCheckCronjob.php
+++ b/app/Support/Cronjobs/UpdateCheckCronjob.php
@@ -41,8 +41,8 @@ class UpdateCheckCronjob extends AbstractCronjob
Log::debug('Now in checkForUpdates()');
// should not check for updates:
- $permission = FireflyConfig::get('permission_update_check', -1);
- $value = (int)$permission->data;
+ $permission = FireflyConfig::get('permission_update_check', -1);
+ $value = (int) $permission->data;
if (1 !== $value) {
Log::debug('Update check is not enabled.');
// get stuff from job:
@@ -56,9 +56,9 @@ class UpdateCheckCronjob extends AbstractCronjob
// TODO this is duplicate.
/** @var Configuration $lastCheckTime */
- $lastCheckTime = FireflyConfig::get('last_update_check', Carbon::now()->getTimestamp());
- $now = Carbon::now()->getTimestamp();
- $diff = $now - $lastCheckTime->data;
+ $lastCheckTime = FireflyConfig::get('last_update_check', Carbon::now()->getTimestamp());
+ $now = Carbon::now()->getTimestamp();
+ $diff = $now - $lastCheckTime->data;
Log::debug(sprintf('Last check time is %d, current time is %d, difference is %d', $lastCheckTime->data, $now, $diff));
if ($diff < 604800 && false === $this->force) {
// get stuff from job:
@@ -74,7 +74,7 @@ class UpdateCheckCronjob extends AbstractCronjob
}
// last check time was more than a week ago.
Log::debug('Have not checked for a new version in a week!');
- $release = $this->getLatestRelease();
+ $release = $this->getLatestRelease();
if ('' !== $release->getError()) {
// get stuff from job:
$this->jobFired = true;
@@ -88,14 +88,22 @@ class UpdateCheckCronjob extends AbstractCronjob
$this->jobFired = true;
$this->jobErrored = false;
$this->jobSucceeded = false;
- $this->message = trans('firefly.no_new_release_available');;
+ $this->message = trans('firefly.no_new_release_available');
+
if ($release->isNewVersionAvailable()) {
// if running develop, slightly different message.
if (str_contains(config('firefly.version'), 'develop')) {
- $this->message = trans('firefly.update_current_dev_older', ['version' => config('firefly.version'), 'new_version' => $release->getNewVersion()]);
+ $this->message = trans('firefly.update_current_dev_older', [
+ 'version' => config('firefly.version'),
+ 'new_version' => $release->getNewVersion(),
+ ]);
}
if (!str_contains(config('firefly.version'), 'develop')) {
- $this->message = trans('firefly.update_new_version_alert', ['your_version' => config('firefly.version'), 'new_version' => $release->getNewVersion(), 'date' => $release->getPublishedAt()->format('Y-m-d H:i:s')]);
+ $this->message = trans('firefly.update_new_version_alert', [
+ 'your_version' => config('firefly.version'),
+ 'new_version' => $release->getNewVersion(),
+ 'date' => $release->getPublishedAt()->format('Y-m-d H:i:s'),
+ ]);
}
}
}
diff --git a/app/Support/Export/ExportDataGenerator.php b/app/Support/Export/ExportDataGenerator.php
index ef189682f0..bdd1eed7c7 100644
--- a/app/Support/Export/ExportDataGenerator.php
+++ b/app/Support/Export/ExportDataGenerator.php
@@ -172,6 +172,8 @@ class ExportDataGenerator
// @phpstan-ignore-line
+ // @phpstan-ignore-line
+
public function __construct()
{
$this->accounts = new Collection();
diff --git a/app/Support/JsonApi/Enrichments/AvailableBudgetEnrichment.php b/app/Support/JsonApi/Enrichments/AvailableBudgetEnrichment.php
index e2df53c2ec..8c59bc3f2c 100644
--- a/app/Support/JsonApi/Enrichments/AvailableBudgetEnrichment.php
+++ b/app/Support/JsonApi/Enrichments/AvailableBudgetEnrichment.php
@@ -82,6 +82,7 @@ class AvailableBudgetEnrichment implements EnrichmentInterface
// @phpstan-ignore-line
// @phpstan-ignore-line
// @phpstan-ignore-line
+ // @phpstan-ignore-line
private readonly bool $convertToPrimary; // @phpstan-ignore-line
// @phpstan-ignore-line
// @phpstan-ignore-line
@@ -124,6 +125,7 @@ class AvailableBudgetEnrichment implements EnrichmentInterface
// @phpstan-ignore-line
// @phpstan-ignore-line
// @phpstan-ignore-line
+ // @phpstan-ignore-line
private array $currencies = [];
private array $currencyIds = [];
private array $ids = [];
diff --git a/app/Support/JsonApi/Enrichments/BudgetLimitEnrichment.php b/app/Support/JsonApi/Enrichments/BudgetLimitEnrichment.php
index 3d4060f705..be77ffc690 100644
--- a/app/Support/JsonApi/Enrichments/BudgetLimitEnrichment.php
+++ b/app/Support/JsonApi/Enrichments/BudgetLimitEnrichment.php
@@ -82,6 +82,7 @@ class BudgetLimitEnrichment implements EnrichmentInterface
// @phpstan-ignore-line
// @phpstan-ignore-line
// @phpstan-ignore-line
+ // @phpstan-ignore-line
private array $currencies = [];
private array $currencyIds = [];
private Carbon $end;
diff --git a/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php b/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php
index 33e3a4d94b..a851aaf599 100644
--- a/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php
+++ b/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php
@@ -84,6 +84,7 @@ class PiggyBankEnrichment implements EnrichmentInterface
// @phpstan-ignore-line
// @phpstan-ignore-line
// @phpstan-ignore-line
+ // @phpstan-ignore-line
private array $accounts = []; // @phpstan-ignore-line
// @phpstan-ignore-line
// @phpstan-ignore-line
@@ -126,6 +127,7 @@ class PiggyBankEnrichment implements EnrichmentInterface
// @phpstan-ignore-line
// @phpstan-ignore-line
// @phpstan-ignore-line
+ // @phpstan-ignore-line
private array $amounts = [];
private Collection $collection;
private array $currencies = [];
diff --git a/app/Support/JsonApi/Enrichments/PiggyBankEventEnrichment.php b/app/Support/JsonApi/Enrichments/PiggyBankEventEnrichment.php
index 80fb94fc2d..7b33ecad2c 100644
--- a/app/Support/JsonApi/Enrichments/PiggyBankEventEnrichment.php
+++ b/app/Support/JsonApi/Enrichments/PiggyBankEventEnrichment.php
@@ -79,6 +79,7 @@ class PiggyBankEventEnrichment implements EnrichmentInterface
// @phpstan-ignore-line
// @phpstan-ignore-line
// @phpstan-ignore-line
+ // @phpstan-ignore-line
private array $accountIds = []; // @phpstan-ignore-line
// @phpstan-ignore-line
// @phpstan-ignore-line
@@ -121,6 +122,7 @@ class PiggyBankEventEnrichment implements EnrichmentInterface
// @phpstan-ignore-line
// @phpstan-ignore-line
// @phpstan-ignore-line
+ // @phpstan-ignore-line
private Collection $collection;
private array $currencies = [];
private array $groupIds = [];
diff --git a/app/Support/JsonApi/Enrichments/SubscriptionEnrichment.php b/app/Support/JsonApi/Enrichments/SubscriptionEnrichment.php
index a8e3e158b0..5572b7ec98 100644
--- a/app/Support/JsonApi/Enrichments/SubscriptionEnrichment.php
+++ b/app/Support/JsonApi/Enrichments/SubscriptionEnrichment.php
@@ -88,6 +88,7 @@ class SubscriptionEnrichment implements EnrichmentInterface
// @phpstan-ignore-line
// @phpstan-ignore-line
// @phpstan-ignore-line
+ // @phpstan-ignore-line
private readonly bool $convertToPrimary;
private ?Carbon $end = null;
private array $mappedObjects = [];
diff --git a/app/Support/JsonApi/Enrichments/TransactionGroupEnrichment.php b/app/Support/JsonApi/Enrichments/TransactionGroupEnrichment.php
index c1542ee878..30669ddf4b 100644
--- a/app/Support/JsonApi/Enrichments/TransactionGroupEnrichment.php
+++ b/app/Support/JsonApi/Enrichments/TransactionGroupEnrichment.php
@@ -137,6 +137,8 @@ class TransactionGroupEnrichment implements EnrichmentInterface
// @phpstan-ignore-line
+ // @phpstan-ignore-line
+
public function __construct()
{
$this->dateFields = ['interest_date', 'book_date', 'process_date', 'due_date', 'payment_date', 'invoice_date'];
diff --git a/app/Support/JsonApi/Enrichments/WebhookEnrichment.php b/app/Support/JsonApi/Enrichments/WebhookEnrichment.php
index 0dc0ec82d2..6ed58dcb0e 100644
--- a/app/Support/JsonApi/Enrichments/WebhookEnrichment.php
+++ b/app/Support/JsonApi/Enrichments/WebhookEnrichment.php
@@ -84,6 +84,7 @@ class WebhookEnrichment implements EnrichmentInterface
// @phpstan-ignore-line
// @phpstan-ignore-line
// @phpstan-ignore-line
+ // @phpstan-ignore-line
private array $ids = []; // @phpstan-ignore-line
// @phpstan-ignore-line
// @phpstan-ignore-line
@@ -126,6 +127,7 @@ class WebhookEnrichment implements EnrichmentInterface
// @phpstan-ignore-line
// @phpstan-ignore-line
// @phpstan-ignore-line
+ // @phpstan-ignore-line
private array $responses = [];
private array $triggers = [];
private array $webhookDeliveries = [];
diff --git a/config/firefly.php b/config/firefly.php
index 1c79ab2f19..b7ed522f9f 100644
--- a/config/firefly.php
+++ b/config/firefly.php
@@ -78,8 +78,8 @@ return [
'running_balance_column' => (bool)envNonEmpty('USE_RUNNING_BALANCE', true), // this is only the default value, is not used.
// see cer.php for exchange rates feature flag.
],
- 'version' => 'develop/2026-02-20',
- 'build_time' => 1771612586,
+ 'version' => 'develop/2026-02-21',
+ 'build_time' => 1771652199,
'api_version' => '2.1.0', // field is no longer used.
'db_version' => 28, // field is no longer used.
diff --git a/tests/integration/Api/Models/Account/ShowControllerTest.php b/tests/integration/Api/Models/Account/ShowControllerTest.php
index 611efa3da9..f2b3aae24f 100644
--- a/tests/integration/Api/Models/Account/ShowControllerTest.php
+++ b/tests/integration/Api/Models/Account/ShowControllerTest.php
@@ -100,7 +100,6 @@ final class ShowControllerTest extends TestCase
Account::factory()
->for($this->user)
->withType(AccountTypeEnum::ASSET)
- ->create()
- ;
+ ->create();
}
}