🤖 Auto commit for release 'develop' on 2025-09-07

This commit is contained in:
JC5
2025-09-07 11:04:11 +02:00
parent f88286c848
commit 12e8651017
17 changed files with 35 additions and 36 deletions

View File

@@ -27,7 +27,6 @@ namespace FireflyIII\Api\V1\Controllers;
use Carbon\Carbon; use Carbon\Carbon;
use Carbon\Exceptions\InvalidFormatException; use Carbon\Exceptions\InvalidFormatException;
use FireflyIII\Exceptions\BadHttpHeaderException; use FireflyIII\Exceptions\BadHttpHeaderException;
use FireflyIII\Models\Preference;
use FireflyIII\Models\TransactionCurrency; use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Support\Facades\Amount; use FireflyIII\Support\Facades\Amount;
use FireflyIII\Support\Facades\Steam; use FireflyIII\Support\Facades\Steam;

View File

@@ -129,7 +129,7 @@ class UserEventHandler
$groupTitle = $user->email; $groupTitle = $user->email;
$index = 1; $index = 1;
/** @var UserGroup|null $group */ /** @var null|UserGroup $group */
$group = null; $group = null;
// create a new group. // create a new group.

View File

@@ -412,7 +412,7 @@ class ProfileController extends Controller
// found user.which email address to return to? // found user.which email address to return to?
$set = app('preferences')->beginsWith($user, 'previous_email_'); $set = app('preferences')->beginsWith($user, 'previous_email_');
/** @var string|null $match */ /** @var null|string $match */
$match = null; $match = null;
foreach ($set as $entry) { foreach ($set as $entry) {
$hashed = hash('sha256', sprintf('%s%s', (string) config('app.key'), $entry->data)); $hashed = hash('sha256', sprintf('%s%s', (string) config('app.key'), $entry->data));

View File

@@ -53,7 +53,7 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte
/** @var GroupMembership $membership */ /** @var GroupMembership $membership */
foreach ($memberships as $membership) { foreach ($memberships as $membership) {
/** @var null|User $user */ /** @var null|User $user */
$user = $membership->user()->first(); $user = $membership->user()->first();
if (null === $user) { if (null === $user) {
continue; continue;
} }
@@ -82,8 +82,8 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte
// all users are now moved away from user group. // all users are now moved away from user group.
// time to DESTROY all objects. // time to DESTROY all objects.
// we have to do this one by one to trigger the necessary observers :( // we have to do this one by one to trigger the necessary observers :(
$objects = ['availableBudgets', 'bills', 'budgets', 'categories', 'currencyExchangeRates', 'objectGroups', $objects = ['availableBudgets', 'bills', 'budgets', 'categories', 'currencyExchangeRates', 'objectGroups',
'recurrences', 'rules', 'ruleGroups', 'tags', 'transactionGroups', 'transactionJournals', 'piggyBanks', 'accounts', 'webhooks', 'recurrences', 'rules', 'ruleGroups', 'tags', 'transactionGroups', 'transactionJournals', 'piggyBanks', 'accounts', 'webhooks',
]; ];
foreach ($objects as $object) { foreach ($objects as $object) {
foreach ($userGroup->{$object}()->get() as $item) { // @phpstan-ignore-line foreach ($userGroup->{$object}()->get() as $item) { // @phpstan-ignore-line
@@ -110,7 +110,7 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte
/** @var null|UserGroup $group */ /** @var null|UserGroup $group */
$group = $membership->userGroup()->first(); $group = $membership->userGroup()->first();
if (null !== $group) { if (null !== $group) {
$groupId = $group->id; $groupId = $group->id;
if (in_array($groupId, array_keys($set), true)) { if (in_array($groupId, array_keys($set), true)) {
continue; continue;
} }
@@ -135,12 +135,12 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte
while ($exists && $loop < 10) { while ($exists && $loop < 10) {
$existingGroup = $this->findByName($groupName); $existingGroup = $this->findByName($groupName);
if (!$existingGroup instanceof UserGroup) { if (!$existingGroup instanceof UserGroup) {
$exists = false; $exists = false;
/** @var UserGroup $existingGroup */ /** @var UserGroup $existingGroup */
$existingGroup = $this->store(['user' => $user, 'title' => $groupName]); $existingGroup = $this->store(['user' => $user, 'title' => $groupName]);
} }
$groupName = sprintf('%s-%s', $user->email, substr(sha1(random_int(1000, 9999) . microtime()), 0, 4)); $groupName = sprintf('%s-%s', $user->email, substr(sha1(random_int(1000, 9999).microtime()), 0, 4));
++$loop; ++$loop;
} }
@@ -160,7 +160,7 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte
$data['user'] = $this->user; $data['user'] = $this->user;
/** @var UserGroupFactory $factory */ /** @var UserGroupFactory $factory */
$factory = app(UserGroupFactory::class); $factory = app(UserGroupFactory::class);
return $factory->create($data); return $factory->create($data);
} }
@@ -191,10 +191,10 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte
{ {
$userGroup->title = $data['title']; $userGroup->title = $data['title'];
$userGroup->save(); $userGroup->save();
$currency = null; $currency = null;
/** @var CurrencyRepositoryInterface $repository */ /** @var CurrencyRepositoryInterface $repository */
$repository = app(CurrencyRepositoryInterface::class); $repository = app(CurrencyRepositoryInterface::class);
if (array_key_exists('primary_currency_code', $data)) { if (array_key_exists('primary_currency_code', $data)) {
$repository->setUser($this->user); $repository->setUser($this->user);
@@ -220,11 +220,11 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte
*/ */
public function updateMembership(UserGroup $userGroup, array $data): UserGroup public function updateMembership(UserGroup $userGroup, array $data): UserGroup
{ {
$owner = UserRole::whereTitle(UserRoleEnum::OWNER)->first(); $owner = UserRole::whereTitle(UserRoleEnum::OWNER)->first();
app('log')->debug('in update membership'); app('log')->debug('in update membership');
/** @var null|User $user */ /** @var null|User $user */
$user = null; $user = null;
if (array_key_exists('id', $data)) { if (array_key_exists('id', $data)) {
/** @var null|User $user */ /** @var null|User $user */
$user = User::find($data['id']); $user = User::find($data['id']);
@@ -263,8 +263,9 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte
if ($membershipCount > 1) { if ($membershipCount > 1) {
// group has multiple members. How many are owner, except the user we're editing now? // group has multiple members. How many are owner, except the user we're editing now?
$ownerCount = $userGroup->groupMemberships() $ownerCount = $userGroup->groupMemberships()
->where('user_role_id', $owner->id) ->where('user_role_id', $owner->id)
->where('user_id', '!=', $user->id)->count(); ->where('user_id', '!=', $user->id)->count()
;
// if there are no other owners and the current users does not get or keep the owner role, refuse. // if there are no other owners and the current users does not get or keep the owner role, refuse.
if ( if (
0 === $ownerCount 0 === $ownerCount

View File

@@ -36,7 +36,7 @@ trait FormSupport
{ {
public function multiSelect(string $name, ?array $list = null, mixed $selected = null, ?array $options = null): string public function multiSelect(string $name, ?array $list = null, mixed $selected = null, ?array $options = null): string
{ {
$list ??= []; $list ??= [];
$label = $this->label($name, $options); $label = $this->label($name, $options);
$options = $this->expandOptionArray($name, $label, $options); $options = $this->expandOptionArray($name, $label, $options);
$classes = $this->getHolderClasses($name); $classes = $this->getHolderClasses($name);
@@ -62,7 +62,7 @@ trait FormSupport
} }
$name = str_replace('[]', '', $name); $name = str_replace('[]', '', $name);
return (string)trans('form.' . $name); return (string)trans('form.'.$name);
} }
/** /**
@@ -70,10 +70,10 @@ trait FormSupport
*/ */
protected function expandOptionArray(string $name, $label, ?array $options = null): array protected function expandOptionArray(string $name, $label, ?array $options = null): array
{ {
$options ??= []; $options ??= [];
$name = str_replace('[]', '', $name); $name = str_replace('[]', '', $name);
$options['class'] = 'form-control'; $options['class'] = 'form-control';
$options['id'] = 'ffInput_' . $name; $options['id'] = 'ffInput_'.$name;
$options['autocomplete'] = 'off'; $options['autocomplete'] = 'off';
$options['placeholder'] = ucfirst((string)$label); $options['placeholder'] = ucfirst((string)$label);
@@ -121,7 +121,7 @@ trait FormSupport
*/ */
public function select(string $name, ?array $list = null, $selected = null, ?array $options = null): string public function select(string $name, ?array $list = null, $selected = null, ?array $options = null): string
{ {
$list ??= []; $list ??= [];
$label = $this->label($name, $options); $label = $this->label($name, $options);
$options = $this->expandOptionArray($name, $label, $options); $options = $this->expandOptionArray($name, $label, $options);
$classes = $this->getHolderClasses($name); $classes = $this->getHolderClasses($name);

View File

@@ -43,7 +43,7 @@ trait CleansChartData
$return = []; $return = [];
/** /**
* @var int $index * @var int $index
* @var array $array * @var array $array
*/ */
foreach ($data as $index => $array) { foreach ($data as $index => $array) {

View File

@@ -103,7 +103,7 @@ trait ConvertsDataTypes
{ {
// assume this all works, because the validator would have caught any errors. // assume this all works, because the validator would have caught any errors.
$parameter = (string)request()->query->get($field); $parameter = (string)request()->query->get($field);
if('' === $parameter) { if ('' === $parameter) {
return []; return [];
} }
$parts = explode(',', $parameter); $parts = explode(',', $parameter);

View File

@@ -184,11 +184,11 @@ class General extends AbstractExtension
static function (string $string): string { static function (string $string): string {
$proto = parse_url($string, PHP_URL_SCHEME); $proto = parse_url($string, PHP_URL_SCHEME);
$host = parse_url($string, PHP_URL_HOST); $host = parse_url($string, PHP_URL_HOST);
if(is_array($host)) { if (is_array($host)) {
$host = join(' ', $host); $host = implode(' ', $host);
} }
if(is_array($proto)) { if (is_array($proto)) {
$proto = join(' ', $proto); $proto = implode(' ', $proto);
} }
return e(sprintf('%s://%s', $proto, $host)); return e(sprintf('%s://%s', $proto, $host));

View File

@@ -107,6 +107,4 @@ class PiggyBankTransformer extends AbstractTransformer
], ],
]; ];
} }
} }

View File

@@ -24,9 +24,6 @@ declare(strict_types=1);
namespace FireflyIII\Transformers; namespace FireflyIII\Transformers;
use FireflyIII\Enums\WebhookDelivery;
use FireflyIII\Enums\WebhookResponse;
use FireflyIII\Enums\WebhookTrigger;
use FireflyIII\Models\Webhook; use FireflyIII\Models\Webhook;
/** /**

View File

@@ -207,7 +207,7 @@ class FireflyValidator extends Validator
$value = strtoupper($value); $value = strtoupper($value);
// replace characters outside of ASCI range. // replace characters outside of ASCI range.
$value = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $value); $value = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $value);
$search = [' ', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; $search = [' ', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
$replace = ['', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35']; $replace = ['', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35'];

View File

@@ -296,7 +296,7 @@ trait TransactionValidation
return true; return true;
} }
return $this->isAsset($account); return $this->isAsset($account);
} }
private function isLiability(Account $account): bool private function isLiability(Account $account): bool

View File

@@ -79,7 +79,7 @@ return [
// see cer.php for exchange rates feature flag. // see cer.php for exchange rates feature flag.
], ],
'version' => 'develop/2025-09-07', 'version' => 'develop/2025-09-07',
'build_time' => 1757224461, 'build_time' => 1757235733,
'api_version' => '2.1.0', // field is no longer used. 'api_version' => '2.1.0', // field is no longer used.
'db_version' => 26, 'db_version' => 26,

View File

@@ -22,6 +22,7 @@
declare(strict_types=1); declare(strict_types=1);
use function Safe\parse_url; use function Safe\parse_url;
return [ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View File

@@ -22,6 +22,7 @@
declare(strict_types=1); declare(strict_types=1);
use function Safe\realpath; use function Safe\realpath;
$paths = [realpath(base_path('resources/views'))]; $paths = [realpath(base_path('resources/views'))];
if ('v2' === env('FIREFLY_III_LAYOUT')) { if ('v2' === env('FIREFLY_III_LAYOUT')) {
$paths = [ $paths = [

View File

@@ -21,9 +21,10 @@
*/ */
declare(strict_types=1); declare(strict_types=1);
use function Safe\define;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
use function Safe\define;
/* /*
* ____ ____ __ .______ ______ __ __ .___________. _______ _______. * ____ ____ __ .______ ______ __ __ .___________. _______ _______.
* \ \ / / /_ | | _ \ / __ \ | | | | | || ____| / | * \ \ / / /_ | | _ \ / __ \ | | | | | || ____| / |

View File

@@ -22,6 +22,7 @@
declare(strict_types=1); declare(strict_types=1);
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
use function Safe\define; use function Safe\define;
if (!defined('DATEFORMAT')) { if (!defined('DATEFORMAT')) {