Compare commits

...

57 Commits

Author SHA1 Message Date
github-actions[bot]
f65ee4d419 Merge pull request #11901 from firefly-iii/release-1772861474
🤖 Automatically merge the PR into the develop branch.
2026-03-07 06:31:23 +01:00
JC5
535fd9777a 🤖 Auto commit for release 'develop' on 2026-03-07 2026-03-07 06:31:14 +01:00
James Cole
5d1fde9cf7 Clean up more errors. 2026-03-07 06:26:08 +01:00
James Cole
922f1e7c1a Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2026-03-07 06:25:45 +01:00
github-actions[bot]
ef5c35c04d Merge pull request #11900 from firefly-iii/release-1772860900
🤖 Automatically merge the PR into the develop branch.
2026-03-07 06:21:47 +01:00
JC5
4dfbdc644c 🤖 Auto commit for release 'develop' on 2026-03-07 2026-03-07 06:21:40 +01:00
James Cole
4a3f45e125 Add empty array 2026-03-07 06:15:55 +01:00
github-actions[bot]
a08f776ffa Merge pull request #11897 from firefly-iii/release-1772828319
🤖 Automatically merge the PR into the develop branch.
2026-03-06 21:18:48 +01:00
JC5
e246c1f4b7 🤖 Auto commit for release 'develop' on 2026-03-06 2026-03-06 21:18:39 +01:00
github-actions[bot]
f2d1e8e184 Merge pull request #11896 from firefly-iii/release-1772825547
🤖 Automatically merge the PR into the develop branch.
2026-03-06 20:32:37 +01:00
JC5
19d8f46f24 🤖 Auto commit for release 'develop' on 2026-03-06 2026-03-06 20:32:27 +01:00
James Cole
9ac991edd7 Fix phpstan issues. 2026-03-06 20:25:07 +01:00
github-actions[bot]
e85f06792b Merge pull request #11889 from firefly-iii/release-1772807505
🤖 Automatically merge the PR into the develop branch.
2026-03-06 15:31:55 +01:00
JC5
b66f95f1dc 🤖 Auto commit for release 'develop' on 2026-03-06 2026-03-06 15:31:45 +01:00
James Cole
4d63146524 Fix more phpstan issues. 2026-03-06 15:24:35 +01:00
James Cole
695f990236 Correct phpstan errors. 2026-03-06 15:18:49 +01:00
James Cole
e882530a69 Clean up various phpstan issues. 2026-03-06 13:52:11 +01:00
James Cole
993a2491e9 Clean up some phpstan issues. 2026-03-06 11:46:04 +01:00
James Cole
f6ea517b5d Fix https://github.com/orgs/firefly-iii/discussions/11879 2026-03-06 11:41:18 +01:00
github-actions[bot]
6f4143bb79 Merge pull request #11888 from firefly-iii/develop
🤖 Automatically merge the PR into the main branch.
2026-03-06 10:07:42 +01:00
github-actions[bot]
4a2c77c6b7 Merge pull request #11887 from firefly-iii/release-1772788047
🤖 Automatically merge the PR into the develop branch.
2026-03-06 10:07:36 +01:00
JC5
0e62f980b0 🤖 Auto commit for release 'v6.5.4' on 2026-03-06 2026-03-06 10:07:27 +01:00
James Cole
41533fd922 Clean up changelog. 2026-03-06 10:01:32 +01:00
James Cole
d6b5fbe341 Expand changelog. 2026-03-06 08:02:30 +01:00
github-actions[bot]
1047e3290b Merge pull request #11886 from firefly-iii/release-1772780441
🤖 Automatically merge the PR into the develop branch.
2026-03-06 08:00:49 +01:00
JC5
8ac4c535b4 🤖 Auto commit for release 'develop' on 2026-03-06 2026-03-06 08:00:41 +01:00
James Cole
2c997d8d95 Removed last phpstan errors 2026-03-06 07:55:04 +01:00
James Cole
419382f9e0 Remove broken code. 2026-03-06 07:45:28 +01:00
James Cole
12f19c6c34 Remove all "@phpstan-ignore-line" entries. 2026-03-06 07:39:12 +01:00
github-actions[bot]
705138aa27 Merge pull request #11885 from firefly-iii/release-1772775428
🤖 Automatically merge the PR into the develop branch.
2026-03-06 06:37:15 +01:00
JC5
36d20137b2 🤖 Auto commit for release 'develop' on 2026-03-06 2026-03-06 06:37:08 +01:00
James Cole
7f08a3f594 Use safe function. 2026-03-06 06:21:36 +01:00
James Cole
a897229958 Add changelog for v6.5.4 2026-03-06 06:12:15 +01:00
James Cole
1fa4632be5 Fix transaction search. 2026-03-06 06:03:12 +01:00
James Cole
221a00a23b Add debug info to track available budget creation. 2026-03-06 05:36:05 +01:00
James Cole
09c3318408 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2026-03-05 20:50:32 +01:00
Sander Dorigo
25ba87babb Better validation for webhook URLs 2026-03-05 10:11:09 +01:00
James Cole
d7e9a42f58 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2026-03-04 20:24:25 +01:00
James Cole
8fd6d99c11 Fix date issues in piggy banks for #11873 2026-03-04 20:21:12 +01:00
github-actions[bot]
463ae00ec2 Merge pull request #11876 from firefly-iii/release-1772642273
🤖 Automatically merge the PR into the develop branch.
2026-03-04 17:38:02 +01:00
JC5
969460d271 🤖 Auto commit for release 'develop' on 2026-03-04 2026-03-04 17:37:53 +01:00
James Cole
8ecfa4b619 Fix #11873 2026-03-04 17:31:42 +01:00
James Cole
55ae86ad62 Merge branch 'main' into develop 2026-03-04 17:28:57 +01:00
github-actions[bot]
5e68d948f3 Merge pull request #11874 from firefly-iii/release-1772634907
🤖 Automatically merge the PR into the develop branch.
2026-03-04 15:35:20 +01:00
JC5
77cae13b95 🤖 Auto commit for release 'develop' on 2026-03-04 2026-03-04 15:35:07 +01:00
Sander Dorigo
49d8a3c32e Catch not numeric numbers 2026-03-04 15:25:32 +01:00
github-actions[bot]
0ad4db8a71 Merge pull request #11872 from firefly-iii/release-1772618461
🤖 Automatically merge the PR into the develop branch.
2026-03-04 11:01:10 +01:00
JC5
ed9754c8d4 🤖 Auto commit for release 'develop' on 2026-03-04 2026-03-04 11:01:01 +01:00
James Cole
7315825475 Update CI workflow to manage environment file
Copy .env.example to .env before running CI and remove .env afterward.

Signed-off-by: James Cole <james@firefly-iii.org>
2026-03-04 10:55:56 +01:00
James Cole
eea23ed756 Update composer update command in CI workflow
Removed the '--no-plugins' option from composer update command.

Signed-off-by: James Cole <james@firefly-iii.org>
2026-03-04 10:42:51 +01:00
James Cole
04875728b4 Remove staticMethod.notFound from ignoreErrors
Signed-off-by: James Cole <james@firefly-iii.org>
2026-03-04 10:42:22 +01:00
James Cole
1fa51a92c6 Ignore staticMethod.notFound error in PHPStan
Signed-off-by: James Cole <james@firefly-iii.org>
2026-03-04 10:24:47 +01:00
Sander Dorigo
f8687d4fc1 New config 2026-03-04 10:01:24 +01:00
James Cole
9b5cf09cc0 Update release.yml to enforce error handling
Removed '|| true' from Mago format, PHPCS, and lint commands to ensure they fail the workflow if errors occur.

Signed-off-by: James Cole <james@firefly-iii.org>
2026-03-04 09:26:08 +01:00
github-actions[bot]
268377ad3a Merge pull request #11870 from firefly-iii/develop
🤖 Automatically merge the PR into the main branch.
2026-03-04 07:52:49 +01:00
github-actions[bot]
93500b8156 Merge pull request #11869 from firefly-iii/release-1772607152
🤖 Automatically merge the PR into the develop branch.
2026-03-04 07:52:42 +01:00
JC5
8a3fb50607 🤖 Auto commit for release 'v6.5.3' on 2026-03-04 2026-03-04 07:52:32 +01:00
242 changed files with 978 additions and 575 deletions

View File

@@ -1264,16 +1264,16 @@
},
{
"name": "symfony/console",
"version": "v8.0.6",
"version": "v8.0.7",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "488285876e807a4777f074041d8bb508623419fa"
"reference": "15ed9008a4ebe2d6a78e4937f74e0c13ef2e618a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/488285876e807a4777f074041d8bb508623419fa",
"reference": "488285876e807a4777f074041d8bb508623419fa",
"url": "https://api.github.com/repos/symfony/console/zipball/15ed9008a4ebe2d6a78e4937f74e0c13ef2e618a",
"reference": "15ed9008a4ebe2d6a78e4937f74e0c13ef2e618a",
"shasum": ""
},
"require": {
@@ -1330,7 +1330,7 @@
"terminal"
],
"support": {
"source": "https://github.com/symfony/console/tree/v8.0.6"
"source": "https://github.com/symfony/console/tree/v8.0.7"
},
"funding": [
{
@@ -1350,7 +1350,7 @@
"type": "tidelift"
}
],
"time": "2026-02-25T16:59:43+00:00"
"time": "2026-03-06T14:06:22+00:00"
},
{
"name": "symfony/deprecation-contracts",

View File

@@ -1,48 +1,49 @@
parameters:
ergebnis:
noExtends:
enabled: false
final:
enabled: false
noParameterWithNullDefaultValue:
enabled: false
noParameterWithNullableTypeDeclaration:
enabled: false
noCompact:
enabled: false
noSwitch:
enabled: false
noNullableReturnTypeDeclaration:
enabled: false
finalInAbstractClass:
enabled: false
noConstructorParameterWithDefaultValue:
enabled: false
noNamedArgument:
enabled: false
noParameterWithContainerTypeDeclaration:
enabled: false
paths:
- ../app
- ../database
- ../routes
- ../config
- ../bootstrap/app.php
- ../bootstrap/providers.php
universalObjectCratesClasses:
- Illuminate\Database\Eloquent\Model
reportUnmatchedIgnoredErrors: true
ignoreErrors:
# these are actually interesting but not right now:
- identifier: notIdentical.alwaysTrue
- identifier: method.notFound
- identifier: nullsafe.neverNull
- identifier: identical.alwaysFalse
- identifier: if.condNotBoolean
# - identifier: booleanNot.exprNotBoolean
- identifier: method.nonObject
- identifier: function.impossibleType
- identifier: booleanNot.exprNotBoolean
- identifier: ternary.condNotBoolean
- identifier: booleanNot.alwaysFalse
- identifier: booleanAnd.alwaysFalse
- identifier: greater.alwaysTrue
- identifier: function.alreadyNarrowedType
- identifier: booleanNot.alwaysTrue
- identifier: property.phpDocType
- identifier: nullCoalesce.offset
- identifier: nullCoalesce.variable
- identifier: larastan.noUnnecessaryCollectionCall
- identifier: varTag.differentVariable
- identifier: identical.alwaysTrue
- identifier: clone.nonObject
- identifier: assign.propertyReadOnly
- identifier: property.nonObject
- identifier: varTag.nativeType
- identifier: booleanAnd.leftAlwaysFalse
- identifier: property.onlyWritten
- identifier: parameter.phpDocType
- identifier: property.dynamicName
- identifier: property.unusedType
- identifier: staticMethod.deprecated
- identifier: greater.invalid
- identifier: instanceof.alwaysTrue
# ignore everything but things that BREAK
- identifier: property.deprecated
- identifier: method.deprecated
@@ -54,7 +55,15 @@ parameters:
- identifier: assign.propertyType
- identifier: return.unusedType
- identifier: return.phpDocType
# all errors below I will never fix.
# all errors below I will (probably) never fix.
- identifier: method.notFound # way too many false positives
- identifier: catch.neverThrown # plenty of errors that are thrown undocumented
- identifier: staticMethod.dynamicName # dont care
- identifier: arguments.count # one false positive
- identifier: property.notFound # false positives
- identifier: method.dynamicName # i dont care
- identifier: staticMethod.dynamicCall # many false positives.
- identifier: argument.templateType # no clue how to fix single occurrence.
# - '#expects view-string\|null, string given#'
# - '#expects view-string, string given#'
# - "#Parameter \\#[1-2] \\$num[1-2] of function bc[a-z]+ expects numeric-string, [a-z\\-|&]+ given#"
@@ -64,7 +73,7 @@ parameters:
path: ../app/Console/Commands/System/CreatesDatabase.php
- identifier: missingType.iterableValue # not interesting enough to fix.
- identifier: varTag.type # needs a custom extension for every repository, not gonna happen.
- '#Dynamic call to static method Illuminate#'
# - '#Dynamic call to static method Illuminate#'
# - '#Call to an undefined method Illuminate\\Database\\Eloquent\\Relations\\HasMany::before#' # is custom scope
# - '#Call to an undefined method Illuminate\\Database\\Eloquent\\Relations\\HasMany::after#' # is custom scope
# - '#Call to an undefined method Illuminate\\Database\\Eloquent\\Relations\\HasMany::withTrashed#' # is to allow soft delete

View File

@@ -174,22 +174,24 @@ jobs:
uses: nhedger/setup-mago@v1
- name: Run CI
run: |
cp .env.example .env
# install all packages etc.
rm -rf vendor composer.lock
composer update --no-scripts --no-plugins -q
composer update --no-scripts -q
# format code.
echo "Will now run Mago Format"
mago format || true
mago format
sudo chown -R runner:docker resources/lang
echo "Will now run PHPCS"
.ci/phpcs.sh || true
.ci/phpcs.sh
# lint and check
echo "Will now run Mago Lint"
mago lint || true
mago lint
echo "Will now run PHPstan"
.ci/phpstan.sh || true
.ci/phpstan.sh
rm .env
- name: Calculate variables
run: |

View File

@@ -63,6 +63,8 @@ abstract class Controller extends BaseController
use ValidatesRequests;
use ValidatesUserGroupTrait;
protected array $acceptedRoles = [];
protected const string CONTENT_TYPE = 'application/vnd.api+json';
protected const string JSON_CONTENT_TYPE = 'application/json';
@@ -222,11 +224,7 @@ abstract class Controller extends BaseController
$value = min(max(1, $value), 2 ** 16);
$bag->set($integer, $value);
}
if (
null === $value
&& 'limit' === $integer // @phpstan-ignore-line
&& auth()->check()
) {
if (null === $value && 'limit' === $integer && auth()->check()) {
// set default for user:
/** @var User $user */
$user = auth()->user();

View File

@@ -256,7 +256,7 @@ final class ListController extends Controller
$unfiltered = $recurringRepos->get();
// filter selection
$collection = $unfiltered->filter(static function (Recurrence $recurrence) use ($currency): null|Recurrence { // @phpstan-ignore-line
$collection = $unfiltered->filter(static function (Recurrence $recurrence) use ($currency): null|Recurrence {
if (array_any(
$recurrence->recurrenceTransactions,
static fn ($transaction): bool => $transaction->transaction_currency_id === $currency->id || $transaction->foreign_currency_id === $currency->id
@@ -306,7 +306,7 @@ final class ListController extends Controller
$ruleRepos = app(RuleRepositoryInterface::class);
$unfiltered = $ruleRepos->getAll();
$collection = $unfiltered->filter(static function (Rule $rule) use ($currency): null|Rule { // @phpstan-ignore-line
$collection = $unfiltered->filter(static function (Rule $rule) use ($currency): null|Rule {
if (array_any(
$rule->ruleTriggers,
static fn ($trigger): bool => 'currency_is' === $trigger->trigger_type && $currency->name === $trigger->trigger_value

View File

@@ -68,7 +68,7 @@ final class TransactionController extends Controller
$description = (string) $request->attributes->get('description');
Log::debug(sprintf('Include deleted? %s', var_export($includeDeleted, true)));
if ('' !== $externalId) {
$count += $this->repository->countByMeta('external_identifier', $externalId, $includeDeleted);
$count += $this->repository->countByMeta('external_id', $externalId, $includeDeleted);
Log::debug(sprintf('Search for transactions with external_identifier "%s", count is now %d', $externalId, $count));
}
if ('' !== $internalRef) {

View File

@@ -112,19 +112,6 @@ final class BasicController extends Controller
return response()->json($return);
}
/**
* Check if date is outside session range.
*/
protected function notInDateRange(Carbon $date, Carbon $start, Carbon $end): bool
{ // Validate a preference
if ($start->greaterThanOrEqualTo($date) && $end->greaterThanOrEqualTo($date)) {
return true;
}
// start and end in the past? use $end
return $start->lessThanOrEqualTo($date) && $end->lessThanOrEqualTo($date);
}
private function getBalanceInformation(Carbon $start, Carbon $end): array
{
Log::debug('getBalanceInformation');

View File

@@ -62,7 +62,7 @@ final class BatchController extends Controller
}
Log::debug(sprintf('Counted %d journals.', count($journals)));
/** @var TransactionJournal $first */
/** @var null|TransactionJournal $first */
$first = $journals->first();
$group = $first?->transactionGroup;
if (null === $group) {

View File

@@ -34,7 +34,9 @@ abstract class AggregateFormRequest extends ApiRequest
/**
* @var ApiRequest[]
*/
protected array $requests = [];
protected array $requests = [];
protected array $acceptedRoles = [];
#[Override]
public function initialize(

View File

@@ -32,7 +32,9 @@ class ApiRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected string $required = '';
protected array $acceptedRoles = [];
protected string $required = '';
public function handleConfig(array $config): void
{

View File

@@ -39,6 +39,8 @@ class AutocompleteRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
public function getData(): array
{
$types = $this->convertString('types');

View File

@@ -39,6 +39,8 @@ class MoveTransactionsRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
public function getAll(): array
{
return ['original_account' => $this->convertInteger('original_account'), 'destination_account' => $this->convertInteger('destination_account')];

View File

@@ -45,6 +45,8 @@ class TransactionRequest extends FormRequest
use ConvertsDataTypes;
use ValidatesBulkTransactionQuery;
protected array $acceptedRoles = [];
public function getAll(): array
{
$data = [];

View File

@@ -36,6 +36,8 @@ class DestroyRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -39,6 +39,8 @@ class ExportRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
public function getAll(): array
{
$result = [

View File

@@ -40,6 +40,8 @@ class SameDateRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -38,7 +38,7 @@ class DateRangeRequest extends ApiRequest
public function withValidator(Validator $validator): void
{
$validator->after(function (Validator $validator): void {
if ($validator->failed()) {
if (count($validator->failed()) > 0) {
return;
}
$start = $this->getCarbonDate('start')?->startOfDay();

View File

@@ -36,7 +36,7 @@ class DateRequest extends ApiRequest
public function withValidator(Validator $validator): void
{
$validator->after(function (Validator $validator): void {
if ($validator->failed()) {
if (count($validator->failed()) > 0) {
return;
}
$date = $this->getCarbonDate('date')?->endOfDay();

View File

@@ -50,7 +50,7 @@ class ObjectTypeApiRequest extends ApiRequest
$this->objectType = $config['object_type'] ?? null;
if (!$this->objectType) {
if (null === $this->objectType) {
throw new RuntimeException('ObjectTypeApiRequest requires a object_type config');
}
}
@@ -75,7 +75,7 @@ class ObjectTypeApiRequest extends ApiRequest
public function withValidator(Validator $validator): void
{
$validator->after(function (Validator $validator): void {
if ($validator->failed()) {
if (count($validator->failed()) > 0) {
return;
}
$type = $this->convertString('types', 'all');

View File

@@ -42,7 +42,7 @@ class QueryRequest extends ApiRequest
public function withValidator(Validator $validator): void
{
$validator->after(function (Validator $validator): void {
if ($validator->failed()) {
if (count($validator->failed()) > 0) {
return;
}
$query = $this->convertString('query');

View File

@@ -41,6 +41,8 @@ class SingleDateRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -45,6 +45,8 @@ class GenericRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
private Collection $accounts;
private Collection $bills;
private Collection $budgets;

View File

@@ -40,7 +40,7 @@ class AccountTypeApiRequest extends ApiRequest
public function withValidator(Validator $validator): void
{
$validator->after(function (Validator $validator): void {
if ($validator->failed()) {
if (count($validator->failed()) > 0) {
return;
}

View File

@@ -42,7 +42,7 @@ class AccountTypesApiRequest extends ApiRequest
public function withValidator(Validator $validator): void
{
$validator->after(function (Validator $validator): void {
if ($validator->failed()) {
if (count($validator->failed()) > 0) {
return;
}
$types = explode(',', $this->convertString('types', 'all'));

View File

@@ -43,6 +43,8 @@ class StoreRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
public function getAllAccountData(): array
{
$active = true;

View File

@@ -46,6 +46,8 @@ class UpdateRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
public function getUpdateData(): array
{
$fields = [

View File

@@ -37,6 +37,8 @@ class StoreRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -37,6 +37,8 @@ class UpdateRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -40,6 +40,8 @@ class Request extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -42,6 +42,8 @@ class StoreRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -41,6 +41,8 @@ class UpdateRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -42,6 +42,8 @@ class StoreRequest extends FormRequest
use ConvertsDataTypes;
use ValidatesAutoBudgetRequest;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -43,6 +43,8 @@ class UpdateRequest extends FormRequest
use ConvertsDataTypes;
use ValidatesAutoBudgetRequest;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -26,6 +26,7 @@ namespace FireflyIII\Api\V1\Requests\Models\BudgetLimit;
use Carbon\Carbon;
use FireflyIII\Factory\TransactionCurrencyFactory;
use FireflyIII\Models\Budget;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\Rules\IsBoolean;
use FireflyIII\Rules\IsValidPositiveAmount;
@@ -44,6 +45,8 @@ class StoreRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/
@@ -85,6 +88,7 @@ class StoreRequest extends FormRequest
*/
public function withValidator(Validator $validator): void
{
/** @var Budget $budget */
$budget = $this->route()->parameter('budget');
$validator->after(static function (Validator $validator) use ($budget): void {
if (0 !== count($validator->failed())) {

View File

@@ -41,6 +41,8 @@ class UpdateRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -36,6 +36,8 @@ class StoreRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -37,6 +37,8 @@ class UpdateRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -34,6 +34,8 @@ class DestroyRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
public function getDate(): ?Carbon
{
return $this->getCarbonDate('date');

View File

@@ -36,6 +36,8 @@ class StoreByCurrenciesRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
public function getAll(): array
{
return $this->all();

View File

@@ -37,6 +37,8 @@ class StoreByDateRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* @return array<string, mixed>
*/

View File

@@ -36,6 +36,8 @@ class StoreRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
public function getDate(): ?Carbon
{
return $this->getCarbonDate('date');

View File

@@ -34,6 +34,8 @@ class UpdateRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
public function getDate(): ?Carbon
{
return $this->getCarbonDate('date');

View File

@@ -37,6 +37,8 @@ class UpdateRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
public function getUpdateData(): array
{
$fields = ['title' => ['title', 'convertString'], 'order' => ['order', 'convertInteger']];

View File

@@ -42,6 +42,8 @@ class StoreRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -40,6 +40,8 @@ class UpdateRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -49,6 +49,8 @@ class StoreRequest extends FormRequest
use RecurrenceValidation;
use TransactionValidation;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -50,6 +50,8 @@ class UpdateRequest extends FormRequest
use RecurrenceValidation;
use TransactionValidation;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -42,6 +42,8 @@ class StoreRequest extends FormRequest
use ConvertsDataTypes;
use GetRuleConfiguration;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -37,6 +37,8 @@ class TestRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
public function getTestParameters(): array
{
return ['page' => $this->getPage(), 'start' => $this->getDate('start'), 'end' => $this->getDate('end'), 'accounts' => $this->getAccounts()];

View File

@@ -37,6 +37,8 @@ class TriggerRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
public function getTriggerParameters(): array
{
return ['start' => $this->getDate('start'), 'end' => $this->getDate('end'), 'accounts' => $this->getAccounts()];

View File

@@ -43,6 +43,8 @@ class UpdateRequest extends FormRequest
use ConvertsDataTypes;
use GetRuleConfiguration;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -35,6 +35,8 @@ class ValidateExpressionRequest extends FormRequest
{
use ChecksLogin;
protected array $acceptedRoles = [];
public function rules(): array
{
return ['expression' => ['required', new IsValidActionExpression()]];

View File

@@ -37,6 +37,8 @@ class StoreRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -37,6 +37,8 @@ class TestRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
public function getTestParameters(): array
{
return ['start' => $this->getDate('start'), 'end' => $this->getDate('end'), 'accounts' => $this->getAccounts()];

View File

@@ -37,6 +37,8 @@ class TriggerRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
public function getTriggerParameters(): array
{
return ['start' => $this->getDate('start'), 'end' => $this->getDate('end'), 'accounts' => $this->getAccounts()];

View File

@@ -38,6 +38,8 @@ class UpdateRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -39,6 +39,8 @@ class StoreRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -40,6 +40,8 @@ class UpdateRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -54,6 +54,8 @@ class StoreRequest extends FormRequest
use GroupValidation;
use TransactionValidation;
protected array $acceptedRoles = [];
/**
* Get all data. Is pretty complex because of all the ??-statements.
*/

View File

@@ -50,6 +50,8 @@ class UpdateRequest extends FormRequest
use GroupValidation;
use TransactionValidation;
protected array $acceptedRoles = [];
private array $arrayFields;
private array $booleanFields;
private array $dateFields;

View File

@@ -37,6 +37,8 @@ class StoreRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -38,6 +38,8 @@ class UpdateRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/
@@ -61,7 +63,7 @@ class UpdateRequest extends FormRequest
*/
public function rules(): array
{
/** @var TransactionCurrency $currency */
/** @var string|TransactionCurrency $currency */
$currency = $this->route()->parameter('currency_code');
if (is_string($currency)) {
$currency = TransactionCurrency::whereCode($currency)->first();

View File

@@ -41,6 +41,8 @@ class StoreRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -41,6 +41,8 @@ class UpdateRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -36,6 +36,8 @@ class StoreRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -38,6 +38,8 @@ class UpdateRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Get all data from the request.
*/

View File

@@ -36,6 +36,8 @@ class UpdateRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
public function getData(): array
{
$fields = [

View File

@@ -27,6 +27,7 @@ namespace FireflyIII\Api\V1\Requests\Models\Webhook;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Webhook;
use FireflyIII\Rules\IsBoolean;
use FireflyIII\Rules\Webhook\IsValidWebhookUrl;
use FireflyIII\Support\Facades\FireflyConfig;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
@@ -42,6 +43,8 @@ class CreateRequest extends FormRequest
use ConvertsDataTypes;
use ValidatesWebhooks;
protected array $acceptedRoles = [];
public function getData(): array
{
$fields = ['title' => ['title', 'convertString'], 'active' => ['active', 'boolean'], 'url' => ['url', 'convertString']];
@@ -83,7 +86,7 @@ class CreateRequest extends FormRequest
'delivery' => 'prohibited',
'deliveries' => 'required|array|min:1|max:1',
'deliveries.*' => sprintf('required|in:%s', $deliveries),
'url' => ['required', sprintf('url:%s', $validProtocols)],
'url' => ['required', sprintf('url:%s', $validProtocols), new IsValidWebhookUrl()],
];
}
}

View File

@@ -27,6 +27,7 @@ namespace FireflyIII\Api\V1\Requests\Models\Webhook;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Webhook;
use FireflyIII\Rules\IsBoolean;
use FireflyIII\Rules\Webhook\IsValidWebhookUrl;
use FireflyIII\Support\Facades\FireflyConfig;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
@@ -42,6 +43,8 @@ class UpdateRequest extends FormRequest
use ConvertsDataTypes;
use ValidatesWebhooks;
protected array $acceptedRoles = [];
public function getData(): array
{
$fields = ['title' => ['title', 'convertString'], 'active' => ['active', 'boolean'], 'url' => ['url', 'convertString']];
@@ -87,7 +90,7 @@ class UpdateRequest extends FormRequest
'delivery' => 'prohibited',
'deliveries' => 'required|array|min:1|max:1',
'deliveries.*' => sprintf('required|in:%s', $deliveries),
'url' => [sprintf('url:%s', $validProtocols), sprintf('uniqueExistingWebhook:%d', $webhook->id)],
'url' => [sprintf('url:%s', $validProtocols), sprintf('uniqueExistingWebhook:%d', $webhook->id), new IsValidWebhookUrl()],
];
}
}

View File

@@ -41,7 +41,7 @@ class PaginationRequest extends ApiRequest
$this->sortClass = $config['sort_class'] ?? null;
if (!$this->sortClass) {
if (null === $this->sortClass) {
throw new RuntimeException('PaginationRequest requires a sort_class config');
}
}
@@ -58,7 +58,7 @@ class PaginationRequest extends ApiRequest
public function withValidator(Validator $validator): void
{
$validator->after(function (Validator $validator): void {
if ($validator->failed()) {
if (count($validator->failed()) > 0) {
return;
}
@@ -72,7 +72,7 @@ class PaginationRequest extends ApiRequest
$page = $this->convertInteger('page');
$page = min(max(1, $page), 2 ** 16);
$offset = ($page - 1) * $limit;
$sort = $this->sortClass ? $this->convertSortParameters('sort', $this->sortClass) : $this->get('sort');
$sort = null !== $this->sortClass ? $this->convertSortParameters('sort', $this->sortClass) : $this->get('sort');
$this->attributes->set('limit', $limit);
$this->attributes->set('sort', $sort);
$this->attributes->set('page', $page);

View File

@@ -45,7 +45,7 @@ class CountRequest extends AggregateFormRequest
public function withValidator(Validator $validator): void
{
$validator->after(function (Validator $validator): void {
if ($validator->failed()) {
if (count($validator->failed()) > 0) {
return;
}
$this->attributes->set('include_deleted', $this->convertBoolean($this->input('include_deleted', 'false')));

View File

@@ -37,7 +37,7 @@ class SearchQueryRequest extends ApiRequest
public function withValidator(Validator $validator): void
{
$validator->after(function (Validator $validator): void {
if ($validator->failed()) {
if (count($validator->failed()) > 0) {
return;
}
$query = $this->convertString('query');

View File

@@ -37,7 +37,9 @@ class UpdateRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
private array $booleans = [
protected array $acceptedRoles = [];
private array $booleans = [
'configuration.is_demo_site',
'configuration.single_user_mode',
'configuration.enable_exchange_rates',
@@ -46,7 +48,7 @@ class UpdateRequest extends FormRequest
'configuration.enable_external_rates',
'configuration.allow_webhooks',
];
private array $integers = ['configuration.permission_update_check', 'configuration.last_update_check'];
private array $integers = ['configuration.permission_update_check', 'configuration.last_update_check'];
/**
* Get all data from the request.

View File

@@ -37,6 +37,8 @@ class UserStoreRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Logged in + owner
*/

View File

@@ -40,6 +40,8 @@ class UserUpdateRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
/**
* Logged in + owner
*/

View File

@@ -36,6 +36,8 @@ class PreferenceStoreRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
public function getAll(): array
{
$array = ['name' => $this->convertString('name'), 'data' => $this->get('data')];

View File

@@ -36,6 +36,8 @@ class PreferenceUpdateRequest extends FormRequest
use ChecksLogin;
use ConvertsDataTypes;
protected array $acceptedRoles = [];
public function getAll(): array
{
$array = ['name' => $this->convertString('name'), 'data' => $this->get('data')];

View File

@@ -83,10 +83,10 @@ class ConvertsDatesToUTC extends Command
}
$this->friendlyInfo(sprintf('Converting field "%s" of model "%s" to UTC.', $field, $shortModel));
$items->each(static function ($item) use ($field, $timezoneField): void {
$date = Carbon::parse($item->{$field}, $item->{$timezoneField}); // @phpstan-ignore-line
$date = Carbon::parse($item->{$field}, $item->{$timezoneField});
$date->setTimezone('UTC');
$item->{$field} = $date->format('Y-m-d H:i:s'); // @phpstan-ignore-line
$item->{$timezoneField} = 'UTC'; // @phpstan-ignore-line
$item->{$field} = $date->format('Y-m-d H:i:s');
$item->{$timezoneField} = 'UTC';
$item->save();
});
}

View File

@@ -57,24 +57,28 @@ class CorrectsIbans extends Command
/** @var Account $account */
foreach ($accounts as $account) {
$userId = $account->user_id;
$userId = $account->user_id;
$set[$userId] ??= [];
$iban = (string) $account->iban;
$iban = (string) $account->iban;
if ('' === $iban) {
continue;
}
$type = $account->accountType->type;
$type = $account->accountType->type;
if (in_array($type, [AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value], true)) {
$type = 'liabilities';
}
// iban already in use! two exceptions exist:
if (
array_key_exists($iban, $set[$userId]) && (
!AccountTypeEnum::EXPENSE->value === $set[$userId][$iban]
&& AccountTypeEnum::REVENUE->value === $type
&& !(AccountTypeEnum::REVENUE->value === $set[$userId][$iban] && AccountTypeEnum::EXPENSE->value === $type)
)
) {
$showWarningAndCorrect = false;
if (array_key_exists($iban, $set[$userId])) {
// the type is a revenue account, and the existing IBAN is NOT an expense account.
if (AccountTypeEnum::REVENUE->value === $type && AccountTypeEnum::EXPENSE->value !== $set[$userId][$iban]) {
$showWarningAndCorrect = true;
}
// the type is an expense account, and the existing IBAN is NOT a revenue account
if (AccountTypeEnum::EXPENSE->value === $type && AccountTypeEnum::REVENUE->value !== $set[$userId][$iban]) {
$showWarningAndCorrect = true;
}
}
if ($showWarningAndCorrect) {
$this->friendlyWarning(sprintf(
'IBAN "%s" is used more than once and will be removed from %s #%d ("%s")',
$iban,

View File

@@ -69,10 +69,6 @@ class CorrectsInvertedBudgetLimits extends Command
$budgetLimit->saveQuietly();
}
if ($set->count() > 0) {
// FIXME here be a available budget event.
}
if (1 === $set->count()) {
$this->friendlyInfo('Corrected one budget limit to have the right start/end dates.');

View File

@@ -322,12 +322,7 @@ class CorrectsUnevenAmount extends Command
foreach ($journals as $entry) {
$sum = (string) $entry->the_sum;
$sum = Steam::floatalize($sum);
if (
!is_numeric($sum)
|| '' === $sum // @phpstan-ignore-line
|| str_contains($sum, 'e')
|| str_contains($sum, ',')
) {
if (!is_numeric($sum) || str_contains($sum, 'e') || str_contains($sum, ',')) {
$message = sprintf('Journal #%d has an invalid sum ("%s"). No sure what to do.', $entry->transaction_journal_id, $entry->the_sum);
$this->friendlyWarning($message);
Log::warning($message);

View File

@@ -57,7 +57,7 @@ class VerifySecurityAlerts extends Command
$version = config('firefly.version');
$disk = Storage::disk('resources');
// Next line is ignored because it's a Laravel Facade.
if (!$disk->has('alerts.json')) { // @phpstan-ignore-line
if (!$disk->has('alerts.json')) {
Log::debug('No alerts.json file present.');
return 0;

View File

@@ -70,7 +70,7 @@ class Cron extends Command
} catch (InvalidArgumentException $e) {
$this->friendlyError(sprintf('"%s" is not a valid date', $this->option('date')));
}
$force = (bool) $this->option('force'); // @phpstan-ignore-line
$force = (bool) $this->option('force');
// Fire exchange rates cron job.
if (true === FireflyConfig::get('enable_external_rates', config('cer.download_enabled'))->data && ($doAll || $this->option('download-cer'))) {

View File

@@ -68,7 +68,7 @@ class RemovesDatabaseDecryption extends Command
* @var string $table
* @var array $fields
*/
foreach ($tables as $table => $fields) { // @phpstan-ignore-line
foreach ($tables as $table => $fields) {
$this->decryptTable($table, $fields);
}
@@ -127,7 +127,7 @@ class RemovesDatabaseDecryption extends Command
}
// A separate routine for preferences table:
if ('preferences' === $table && is_string($value)) {
if ('preferences' === $table) {
$this->decryptPreferencesRow($id, $value);
return;

View File

@@ -101,8 +101,13 @@ class UpgradesLiabilitiesEight extends Command
private function hasBadOpening(Account $account): bool
{
/** @var TransactionType $openingBalanceType */
$openingBalanceType = TransactionType::whereType(TransactionTypeEnum::OPENING_BALANCE->value)->first();
/** @var TransactionType $liabilityType */
$liabilityType = TransactionType::whereType(TransactionTypeEnum::LIABILITY_CREDIT->value)->first();
/** @var null|TransactionJournal $openingJournal */
$openingJournal = TransactionJournal::leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
->where('transactions.account_id', $account->id)
->where('transaction_journals.transaction_type_id', $openingBalanceType->id)
@@ -111,6 +116,8 @@ class UpgradesLiabilitiesEight extends Command
if (null === $openingJournal) {
return false;
}
/** @var null|TransactionJournal $liabilityJournal */
$liabilityJournal = TransactionJournal::leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
->where('transactions.account_id', $account->id)
->where('transaction_journals.transaction_type_id', $liabilityType->id)
@@ -120,7 +127,7 @@ class UpgradesLiabilitiesEight extends Command
return false;
}
return (bool) $openingJournal->date->isSameDay($liabilityJournal->date);
return $openingJournal->date->isSameDay($liabilityJournal->date);
}
private function isExecuted(): bool

View File

@@ -27,6 +27,7 @@ namespace FireflyIII\Events\Model\BudgetLimit;
use FireflyIII\Events\Event;
use FireflyIII\Models\BudgetLimit;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
class CreatedBudgetLimit extends Event
{
@@ -35,5 +36,7 @@ class CreatedBudgetLimit extends Event
public function __construct(
public BudgetLimit $budgetLimit,
public bool $createWebhookMessages
) {}
) {
Log::debug(sprintf('CreatedNewBudgetLimit(#%d) Event', $budgetLimit->id));
}
}

View File

@@ -29,6 +29,7 @@ use FireflyIII\Events\Event;
use FireflyIII\Models\Budget;
use FireflyIII\User;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
class DestroyedBudgetLimit extends Event
{
@@ -40,5 +41,7 @@ class DestroyedBudgetLimit extends Event
public Carbon $start,
public Carbon $end,
public bool $createWebhookMessages
) {}
) {
Log::debug(sprintf('DestroyedBudgetLimit(#%d) Event', $budget->id));
}
}

View File

@@ -27,6 +27,7 @@ namespace FireflyIII\Events\Model\BudgetLimit;
use FireflyIII\Events\Event;
use FireflyIII\Models\BudgetLimit;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
class UpdatedBudgetLimit extends Event
{
@@ -35,5 +36,7 @@ class UpdatedBudgetLimit extends Event
public function __construct(
public BudgetLimit $budgetLimit,
public bool $createWebhookMessages
) {}
) {
Log::debug(sprintf('UpdatedBudgetLimit(#%d) Event', $budgetLimit->id));
}
}

View File

@@ -36,7 +36,7 @@ final class IntervalException extends Exception
public array $availableIntervals = [];
public Periodicity $periodicity = Periodicity::Monthly;
/** @var mixed */
/** @var string */
protected $message = 'The periodicity %s is unknown. Choose one of available periodicity: %s';
public function __construct(string $message = '', int $code = 0, ?Throwable $previous = null)

View File

@@ -158,9 +158,9 @@ class PiggyBankFactory
// event(new ChangedAmount($piggyBank, $diff, null, null));
}
// no amount set, use previous amount or go to ZERO.
$toBeLinked[$account->id] = ['current_amount' => $toBeLinked[$account->id]['current_amount'] ?? '0'];
Log::debug(sprintf('[b] Will link account #%d with amount %s', $account->id, $toBeLinked[$account->id]['current_amount'] ?? '0'));
// no amount set, use previous amount
$toBeLinked[$account->id] = ['current_amount' => $toBeLinked[$account->id]['current_amount']];
Log::debug(sprintf('[b] Will link account #%d with amount %s', $account->id, $toBeLinked[$account->id]['current_amount']));
// create event:
Log::debug('linkToAccountIds: Trigger change for positive amount [b].');

View File

@@ -338,7 +338,7 @@ class TransactionJournalFactory
'date_tz' => $carbon->format('e'),
'order' => $order,
'tag_count' => 0,
'completed' => !$row['batch_submission'],
'completed' => is_bool($row['batch_submission']) && !$row['batch_submission'],
]);
Log::debug(sprintf('Created new journal #%d: "%s"', $journal->id, $journal->description));
@@ -574,16 +574,11 @@ class TransactionJournalFactory
return [$sourceAccount, $account];
}
if (!$sourceAccount instanceof Account) { // @phpstan-ignore-line
Log::debug('Source account is NULL, destination account is not.');
$account = $this->accountRepository->getReconciliation($destinationAccount);
Log::debug(sprintf('Will return account #%d ("%s") of type "%s"', $account->id, $account->name, $account->accountType->type));
Log::debug('Source account is NULL, destination account is not.');
$account = $this->accountRepository->getReconciliation($destinationAccount);
Log::debug(sprintf('Will return account #%d ("%s") of type "%s"', $account->id, $account->name, $account->accountType->type));
return [$account, $destinationAccount];
}
Log::debug('Unused fallback'); // @phpstan-ignore-line
return [$sourceAccount, $destinationAccount];
return [$account, $destinationAccount];
}
private function storeLocation(TransactionJournal $journal, NullArrayObject $data): void

View File

@@ -178,7 +178,7 @@ trait AccountCollection
{
if ($accounts->count() > 0) {
$accountIds = $accounts->pluck('id')->toArray();
$this->query->where(static function (EloquentBuilder $query) use ($accountIds): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $query) use ($accountIds): void {
$query->whereIn('source.account_id', $accountIds);
$query->orWhereIn('destination.account_id', $accountIds);
});
@@ -196,7 +196,7 @@ trait AccountCollection
{
if ($accounts->count() > 0) {
$accountIds = $accounts->pluck('id')->toArray();
$this->query->where(static function (EloquentBuilder $query) use ($accountIds): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $query) use ($accountIds): void {
$query->whereIn('source.account_id', $accountIds);
$query->whereIn('destination.account_id', $accountIds);
});
@@ -228,7 +228,7 @@ trait AccountCollection
{
if ($accounts->count() > 0) {
$accountIds = $accounts->pluck('id')->toArray();
$this->query->where(static function (EloquentBuilder $query) use ($accountIds): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $query) use ($accountIds): void {
$query->whereNotIn('source.account_id', $accountIds);
$query->whereNotIn('destination.account_id', $accountIds);
});
@@ -261,7 +261,7 @@ trait AccountCollection
{
if ($accounts->count() > 0) {
$accountIds = $accounts->pluck('id')->toArray();
$this->query->where(static function (EloquentBuilder $q1) use ($accountIds): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $q1) use ($accountIds): void {
// sourceAccount is in the set, and destination is NOT.
$q1->where(static function (EloquentBuilder $q2) use ($accountIds): void {

View File

@@ -38,7 +38,7 @@ trait AmountCollection
*/
public function amountIs(string $amount): GroupCollectorInterface
{
$this->query->where(static function (EloquentBuilder $q) use ($amount): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $q) use ($amount): void {
$q->where('source.amount', Steam::negative($amount));
});
@@ -47,7 +47,7 @@ trait AmountCollection
public function amountIsNot(string $amount): GroupCollectorInterface
{
$this->query->where(static function (EloquentBuilder $q) use ($amount): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $q) use ($amount): void {
$q->where('source.amount', '!=', Steam::negative($amount));
});
@@ -59,7 +59,7 @@ trait AmountCollection
*/
public function amountLess(string $amount): GroupCollectorInterface
{
$this->query->where(static function (EloquentBuilder $q) use ($amount): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $q) use ($amount): void {
$q->where('destination.amount', '<=', Steam::positive($amount));
});
@@ -71,7 +71,7 @@ trait AmountCollection
*/
public function amountMore(string $amount): GroupCollectorInterface
{
$this->query->where(static function (EloquentBuilder $q) use ($amount): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $q) use ($amount): void {
$q->where('destination.amount', '>=', Steam::positive($amount));
});
@@ -83,7 +83,7 @@ trait AmountCollection
*/
public function foreignAmountIs(string $amount): GroupCollectorInterface
{
$this->query->where(static function (EloquentBuilder $q) use ($amount): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $q) use ($amount): void {
$q->whereNotNull('source.foreign_amount');
$q->where('source.foreign_amount', Steam::negative($amount));
});
@@ -96,7 +96,7 @@ trait AmountCollection
*/
public function foreignAmountIsNot(string $amount): GroupCollectorInterface
{
$this->query->where(static function (EloquentBuilder $q) use ($amount): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $q) use ($amount): void {
$q->whereNull('source.foreign_amount');
$q->orWhere('source.foreign_amount', '!=', Steam::negative($amount));
});
@@ -109,7 +109,7 @@ trait AmountCollection
*/
public function foreignAmountLess(string $amount): GroupCollectorInterface
{
$this->query->where(static function (EloquentBuilder $q) use ($amount): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $q) use ($amount): void {
$q->whereNotNull('destination.foreign_amount');
$q->where('destination.foreign_amount', '<=', Steam::positive($amount));
});
@@ -122,7 +122,7 @@ trait AmountCollection
*/
public function foreignAmountMore(string $amount): GroupCollectorInterface
{
$this->query->where(static function (EloquentBuilder $q) use ($amount): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $q) use ($amount): void {
$q->whereNotNull('destination.foreign_amount');
$q->where('destination.foreign_amount', '>=', Steam::positive($amount));
});

View File

@@ -483,7 +483,7 @@ trait AttachmentCollection
Log::debug('Add filter on no attachments.');
$this->joinAttachmentTables();
$this->query->where(static function (EloquentBuilder $q1): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $q1): void {
$q1->whereNull('attachments.attachable_id')->orWhere(static function (EloquentBuilder $q2): void {
$q2->whereNotNull('attachments.attachable_id')->whereNotNull('attachments.deleted_at');
@@ -517,7 +517,7 @@ trait AttachmentCollection
$this->hasJoinedAttTables = true;
$this->query
->leftJoin('attachments', 'attachments.attachable_id', '=', 'transaction_journals.id')
->where(static function (EloquentBuilder $q1): void { // @phpstan-ignore-line
->where(static function (EloquentBuilder $q1): void {
$q1->where('attachments.attachable_type', TransactionJournal::class);
// $q1->where('attachments.uploaded', true);
// $q1->whereNull('attachments.deleted_at');

View File

@@ -46,7 +46,7 @@ trait MetaCollection
public function excludeBills(Collection $bills): GroupCollectorInterface
{
$this->withBillInformation();
$this->query->where(static function (EloquentBuilder $q1) use ($bills): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $q1) use ($bills): void {
$q1->whereNotIn('transaction_journals.bill_id', $bills->pluck('id')->toArray());
$q1->orWhereNull('transaction_journals.bill_id');
});
@@ -61,7 +61,7 @@ trait MetaCollection
{
$this->withBudgetInformation();
$this->query->where(static function (EloquentBuilder $q2) use ($budget): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $q2) use ($budget): void {
$q2->where('budgets.id', '!=', $budget->id);
$q2->orWhereNull('budgets.id');
});
@@ -73,7 +73,7 @@ trait MetaCollection
{
if ($budgets->count() > 0) {
$this->withBudgetInformation();
$this->query->where(static function (EloquentBuilder $q1) use ($budgets): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $q1) use ($budgets): void {
$q1->whereNotIn('budgets.id', $budgets->pluck('id')->toArray());
$q1->orWhereNull('budgets.id');
});
@@ -86,7 +86,7 @@ trait MetaCollection
{
if ($categories->count() > 0) {
$this->withCategoryInformation();
$this->query->where(static function (EloquentBuilder $q1) use ($categories): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $q1) use ($categories): void {
$q1->whereNotIn('categories.id', $categories->pluck('id')->toArray());
$q1->orWhereNull('categories.id');
});
@@ -102,7 +102,7 @@ trait MetaCollection
{
$this->withCategoryInformation();
$this->query->where(static function (EloquentBuilder $q2) use ($category): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $q2) use ($category): void {
$q2->where('categories.id', '!=', $category->id);
$q2->orWhereNull('categories.id');
});
@@ -394,7 +394,7 @@ trait MetaCollection
public function notesDoNotContain(string $value): GroupCollectorInterface
{
$this->withNotes();
$this->query->where(static function (EloquentBuilder $q) use ($value): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $q) use ($value): void {
$q->whereNull('notes.text');
$q->orWhereNotLike('notes.text', sprintf('%%%s%%', $value));
});
@@ -405,7 +405,7 @@ trait MetaCollection
public function notesDontEndWith(string $value): GroupCollectorInterface
{
$this->withNotes();
$this->query->where(static function (EloquentBuilder $q) use ($value): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $q) use ($value): void {
$q->whereNull('notes.text');
$q->orWhereNotLike('notes.text', sprintf('%%%s', $value));
});
@@ -416,7 +416,7 @@ trait MetaCollection
public function notesDontStartWith(string $value): GroupCollectorInterface
{
$this->withNotes();
$this->query->where(static function (EloquentBuilder $q) use ($value): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $q) use ($value): void {
$q->whereNull('notes.text');
$q->orWhereNotLike('notes.text', sprintf('%s%%', $value));
});
@@ -443,7 +443,7 @@ trait MetaCollection
public function notesExactlyNot(string $value): GroupCollectorInterface
{
$this->withNotes();
$this->query->where(static function (EloquentBuilder $q) use ($value): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $q) use ($value): void {
$q->whereNull('notes.text');
$q->orWhere('notes.text', '!=', $value);
});
@@ -889,7 +889,7 @@ trait MetaCollection
{
$this->joinMetaDataTables();
// TODO not sure if this will work properly.
$this->query->where(static function (EloquentBuilder $q1): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $q1): void {
$q1->where(static function (EloquentBuilder $q2): void {
$q2->where('journal_meta.name', '=', 'external_id');
$q2->whereNull('journal_meta.data');
@@ -910,7 +910,7 @@ trait MetaCollection
{
$this->joinMetaDataTables();
// TODO not sure if this will work properly.
$this->query->where(static function (EloquentBuilder $q1): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $q1): void {
$q1->where(static function (EloquentBuilder $q2): void {
$q2->where('journal_meta.name', '=', 'external_url');
$q2->whereNull('journal_meta.data');
@@ -930,7 +930,7 @@ trait MetaCollection
public function withoutNotes(): GroupCollectorInterface
{
$this->withNotes();
$this->query->where(static function (EloquentBuilder $q): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $q): void {
$q->whereNull('notes.text');
$q->orWhere('notes.text', '');
});

View File

@@ -314,7 +314,7 @@ class GroupCollector implements GroupCollectorInterface
public function excludeForeignCurrency(TransactionCurrency $currency): GroupCollectorInterface
{
$this->query->where(static function (EloquentBuilder $q2) use ($currency): void { // @phpstan-ignore-line
$this->query->where(static function (EloquentBuilder $q2) use ($currency): void {
$q2->where('source.foreign_currency_id', '!=', $currency->id);
$q2->orWhereNull('source.foreign_currency_id');
});
@@ -698,7 +698,7 @@ class GroupCollector implements GroupCollectorInterface
*/
foreach ($this->sorting as $field => $direction) {
$func = 'ASC' === $direction ? 'sortBy' : 'sortByDesc';
$collection = $collection->{$func}(static function (array $product, int $key) use ($field) { // @phpstan-ignore-line
$collection = $collection->{$func}(static function (array $product, int $key) use ($field) {
// depends on $field:
if ('description' === $field) {
if (1 === count($product['transactions'])) {

View File

@@ -275,7 +275,7 @@ final class LoginController extends Controller
$request->session()->regenerate();
$this->clearLoginAttempts($request);
$response = $this->authenticated($request, $this->guard()->user());
if ($response) {
if (null !== $response) {
return $response;
}
$path = Steam::getSafeUrl(session()->pull('url.intended', route('index')), route('index'));

View File

@@ -176,7 +176,7 @@ final class RegisterController extends Controller
/**
* @throws FireflyException
*/
protected function allowedToRegister(): bool
private function allowedToRegister(): bool
{
// is allowed to register?
$allowRegistration = true;

View File

@@ -135,7 +135,7 @@ final class ExpenseReportController extends Controller
while ($currentStart < $end) {
$currentEnd = clone $currentStart;
$currentEnd = $currentEnd->{$function}(); // @phpstan-ignore-line
$currentEnd = $currentEnd->{$function}();
// get expenses grouped by opposing name:
$expenses = $this->groupByName($this->getExpensesForOpposing($accounts, $all, $currentStart, $currentEnd));

View File

@@ -102,7 +102,7 @@ abstract class Controller extends BaseController
if ('true' === request()->get('force_default_layout') && 'v2' === config('view.layout')) {
// config('view.layout','v1');
Config::set('view.layout', 'v1');
View::getFinder()->setPaths([realpath(base_path('resources/views'))]); // @phpstan-ignore-line
View::getFinder()->setPaths([realpath(base_path('resources/views'))]);
}
View::share('authGuard', $authGuard);

Some files were not shown because too many files have changed in this diff Show More