Various code cleanup

This commit is contained in:
James Cole
2023-09-20 06:36:43 +02:00
parent 6b5774a66d
commit 7bf7bb529e
48 changed files with 348 additions and 84 deletions

View File

@@ -226,16 +226,16 @@
}, },
{ {
"name": "friendsofphp/php-cs-fixer", "name": "friendsofphp/php-cs-fixer",
"version": "v3.26.1", "version": "v3.27.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
"reference": "d023ba6684055f6ea1da1352d8a02baca0426983" "reference": "e73ccaae1208f017bb7860986eebb3da48bd25d6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d023ba6684055f6ea1da1352d8a02baca0426983", "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/e73ccaae1208f017bb7860986eebb3da48bd25d6",
"reference": "d023ba6684055f6ea1da1352d8a02baca0426983", "reference": "e73ccaae1208f017bb7860986eebb3da48bd25d6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -309,7 +309,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.26.1" "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.27.0"
}, },
"funding": [ "funding": [
{ {
@@ -317,7 +317,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-09-08T19:09:07+00:00" "time": "2023-09-17T14:37:54+00:00"
}, },
{ {
"name": "psr/container", "name": "psr/container",

View File

@@ -1,6 +1,6 @@
<?php <?php
declare(strict_types=1);
/* /*
* BalanceController.php * BalanceController.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -21,6 +21,9 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Api\V2\Controllers\Chart; namespace FireflyIII\Api\V2\Controllers\Chart;
use Carbon\Carbon; use Carbon\Carbon;

View File

@@ -1,6 +1,6 @@
<?php <?php
declare(strict_types=1);
/* /*
* BudgetController.php * BudgetController.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -21,6 +21,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Api\V2\Controllers\Chart; namespace FireflyIII\Api\V2\Controllers\Chart;
use Carbon\Carbon; use Carbon\Carbon;

View File

@@ -1,8 +1,8 @@
<?php <?php
declare(strict_types=1);
/* /*
* BudgetController.php * CategoryController.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
@@ -21,6 +21,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Api\V2\Controllers\Chart; namespace FireflyIII\Api\V2\Controllers\Chart;
use Carbon\Carbon; use Carbon\Carbon;

View File

@@ -1,6 +1,6 @@
<?php <?php
declare(strict_types=1);
/* /*
* ShowController.php * ShowController.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -21,6 +21,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Api\V2\Controllers\Model\Bill; namespace FireflyIII\Api\V2\Controllers\Model\Bill;
use FireflyIII\Api\V2\Controllers\Controller; use FireflyIII\Api\V2\Controllers\Controller;

View File

@@ -1,6 +1,6 @@
<?php <?php
declare(strict_types=1);
/* /*
* ShowController.php * ShowController.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -21,6 +21,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Api\V2\Controllers\Model\PiggyBank; namespace FireflyIII\Api\V2\Controllers\Model\PiggyBank;
use FireflyIII\Api\V2\Controllers\Controller; use FireflyIII\Api\V2\Controllers\Controller;

View File

@@ -1,6 +1,6 @@
<?php <?php
declare(strict_types=1);
/* /*
* StoreController.php * StoreController.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -21,6 +21,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Api\V2\Controllers\Model\Transaction; namespace FireflyIII\Api\V2\Controllers\Model\Transaction;
use FireflyIII\Api\V2\Controllers\Controller; use FireflyIII\Api\V2\Controllers\Controller;

View File

@@ -1,4 +1,6 @@
<?php <?php
/* /*
* DestroyController.php * DestroyController.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -19,6 +21,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Api\V2\Controllers\UserGroup; namespace FireflyIII\Api\V2\Controllers\UserGroup;
use FireflyIII\Api\V2\Controllers\Controller; use FireflyIII\Api\V2\Controllers\Controller;
@@ -28,5 +32,4 @@ use FireflyIII\Api\V2\Controllers\Controller;
*/ */
class DestroyController extends Controller class DestroyController extends Controller
{ {
} }

View File

@@ -1,4 +1,6 @@
<?php <?php
/* /*
* ShowController.php * ShowController.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -19,6 +21,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Api\V2\Controllers\UserGroup; namespace FireflyIII\Api\V2\Controllers\UserGroup;
use FireflyIII\Api\V2\Controllers\Controller; use FireflyIII\Api\V2\Controllers\Controller;

View File

@@ -1,4 +1,6 @@
<?php <?php
/* /*
* StoreController.php * StoreController.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -19,6 +21,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Api\V2\Controllers\UserGroup; namespace FireflyIII\Api\V2\Controllers\UserGroup;
use FireflyIII\Api\V2\Controllers\Controller; use FireflyIII\Api\V2\Controllers\Controller;
@@ -50,6 +54,8 @@ class StoreController extends Controller
} }
/** /**
* @param StoreRequest $request
*
* @return JsonResponse * @return JsonResponse
*/ */
public function store(StoreRequest $request): JsonResponse public function store(StoreRequest $request): JsonResponse

View File

@@ -1,4 +1,6 @@
<?php <?php
/* /*
* UpdateController.php * UpdateController.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -19,13 +21,17 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Api\V2\Controllers\UserGroup; namespace FireflyIII\Api\V2\Controllers\UserGroup;
use FireflyIII\Api\V2\Controllers\Controller; use FireflyIII\Api\V2\Controllers\Controller;
/**
* Class UpdateController
*/
class UpdateController extends Controller class UpdateController extends Controller
{ {
// basic edit van group // basic edit van group
// add user, add rights, remove user, remove rights. // add user, add rights, remove user, remove rights.
} }

View File

@@ -1,6 +1,6 @@
<?php <?php
declare(strict_types=1);
/* /*
* BalanceChartRequest.php * BalanceChartRequest.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -21,6 +21,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Api\V2\Request\Chart; namespace FireflyIII\Api\V2\Request\Chart;
use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ChecksLogin;
@@ -28,6 +30,9 @@ use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest; use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Validator; use Illuminate\Validation\Validator;
/**
* Class BalanceChartRequest
*/
class BalanceChartRequest extends FormRequest class BalanceChartRequest extends FormRequest
{ {
use ConvertsDataTypes; use ConvertsDataTypes;

View File

@@ -1,4 +1,6 @@
<?php <?php
/* /*
* StoreRequest.php * StoreRequest.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -19,12 +21,17 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Api\V2\Request\UserGroup; namespace FireflyIII\Api\V2\Request\UserGroup;
use FireflyIII\Support\Request\ChecksLogin; use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes; use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest; use Illuminate\Foundation\Http\FormRequest;
/**
* Class StoreRequest
*/
class StoreRequest extends FormRequest class StoreRequest extends FormRequest
{ {
use ChecksLogin; use ChecksLogin;

View File

@@ -1,6 +1,6 @@
<?php <?php
declare(strict_types=1);
/* /*
* OutputVersion.php * OutputVersion.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -21,25 +21,29 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Console\Commands\System; namespace FireflyIII\Console\Commands\System;
use Illuminate\Console\Command; use Illuminate\Console\Command;
/**
* Class OutputVersion
*/
class OutputVersion extends Command class OutputVersion extends Command
{ {
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:output-version';
/** /**
* The console command description. * The console command description.
* *
* @var string * @var string
*/ */
protected $description = 'Outputs the Firefly III version'; protected $description = 'Outputs the Firefly III version';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:output-version';
/** /**
* Execute the console command. * Execute the console command.

View File

@@ -1,6 +1,6 @@
<?php <?php
declare(strict_types=1);
/* /*
* RuleActionFailedOnArray.php * RuleActionFailedOnArray.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -21,6 +21,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Events\Model\Rule; namespace FireflyIII\Events\Model\Rule;
use FireflyIII\Models\RuleAction; use FireflyIII\Models\RuleAction;

View File

@@ -1,8 +1,8 @@
<?php <?php
declare(strict_types=1);
/* /*
* RuleActionFailedOnArray.php * RuleActionFailedOnObject.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
* *
* This file is part of Firefly III (https://github.com/firefly-iii). * This file is part of Firefly III (https://github.com/firefly-iii).
@@ -21,6 +21,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Events\Model\Rule; namespace FireflyIII\Events\Model\Rule;
use FireflyIII\Models\RuleAction; use FireflyIII\Models\RuleAction;

View File

@@ -1,4 +1,6 @@
<?php <?php
/* /*
* UserGroupFactory.php * UserGroupFactory.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -19,6 +21,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Factory; namespace FireflyIII\Factory;
use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Enums\UserRoleEnum;

View File

@@ -1,6 +1,6 @@
<?php <?php
declare(strict_types=1);
/* /*
* RuleHandler.php * RuleHandler.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -21,6 +21,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Handlers\Events\Model; namespace FireflyIII\Handlers\Events\Model;
use FireflyIII\Events\Model\Rule\RuleActionFailedOnArray; use FireflyIII\Events\Model\Rule\RuleActionFailedOnArray;

View File

@@ -76,7 +76,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* @method static Builder|Rule withoutTrashed() * @method static Builder|Rule withoutTrashed()
* @property int|null $user_group_id * @property int|null $user_group_id
* @method static \Illuminate\Database\Eloquent\Builder|Rule whereUserGroupId($value) * @method static \Illuminate\Database\Eloquent\Builder|Rule whereUserGroupId($value)
* @property-read \FireflyIII\Models\UserGroup|null $userGroup * @property-read UserGroup|null $userGroup
* @mixin Eloquent * @mixin Eloquent
*/ */
class Rule extends Model class Rule extends Model
@@ -125,14 +125,6 @@ class Rule extends Model
throw new NotFoundHttpException(); throw new NotFoundHttpException();
} }
/**
* @return BelongsTo
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
/** /**
* @return HasMany * @return HasMany
*/ */
@@ -167,6 +159,14 @@ class Rule extends Model
$this->attributes['description'] = e($value); $this->attributes['description'] = e($value);
} }
/**
* @return BelongsTo
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
/** /**
* @return BelongsTo * @return BelongsTo
*/ */

View File

@@ -61,7 +61,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* @method static Builder|TransactionGroup withoutTrashed() * @method static Builder|TransactionGroup withoutTrashed()
* @property int|null $user_group_id * @property int|null $user_group_id
* @method static \Illuminate\Database\Eloquent\Builder|TransactionGroup whereUserGroupId($value) * @method static \Illuminate\Database\Eloquent\Builder|TransactionGroup whereUserGroupId($value)
* @property-read \FireflyIII\Models\UserGroup|null $userGroup * @property-read UserGroup|null $userGroup
* @mixin Eloquent * @mixin Eloquent
*/ */
class TransactionGroup extends Model class TransactionGroup extends Model
@@ -116,14 +116,6 @@ class TransactionGroup extends Model
throw new NotFoundHttpException(); throw new NotFoundHttpException();
} }
/**
* @return BelongsTo
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
/** /**
* @return HasMany * @return HasMany
*/ */
@@ -132,6 +124,14 @@ class TransactionGroup extends Model
return $this->hasMany(TransactionJournal::class); return $this->hasMany(TransactionJournal::class);
} }
/**
* @return BelongsTo
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
/** /**
* @return BelongsTo * @return BelongsTo
*/ */

View File

@@ -33,7 +33,6 @@ use Illuminate\Notifications\Notification;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Illuminate\Notifications\Messages\SlackMessage; use Illuminate\Notifications\Messages\SlackMessage;
/** /**
* Class UserLogin * Class UserLogin
*/ */

View File

@@ -1,6 +1,6 @@
<?php <?php
declare(strict_types=1);
/* /*
* BillRepository.php * BillRepository.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -21,6 +21,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Repositories\Administration\Bill; namespace FireflyIII\Repositories\Administration\Bill;
use Carbon\Carbon; use Carbon\Carbon;

View File

@@ -1,6 +1,6 @@
<?php <?php
declare(strict_types=1);
/* /*
* BillRepositoryInterface.php * BillRepositoryInterface.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -21,6 +21,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Repositories\Administration\Bill; namespace FireflyIII\Repositories\Administration\Bill;
use Carbon\Carbon; use Carbon\Carbon;

View File

@@ -1,6 +1,6 @@
<?php <?php
declare(strict_types=1);
/* /*
* AvailableBudgetRepository.php * AvailableBudgetRepository.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -21,6 +21,9 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Repositories\Administration\Budget; namespace FireflyIII\Repositories\Administration\Budget;
use Carbon\Carbon; use Carbon\Carbon;

View File

@@ -1,6 +1,6 @@
<?php <?php
declare(strict_types=1);
/* /*
* AvailableBudgetRepositoryInterface.php * AvailableBudgetRepositoryInterface.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -21,6 +21,9 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Repositories\Administration\Budget; namespace FireflyIII\Repositories\Administration\Budget;
use Carbon\Carbon; use Carbon\Carbon;

View File

@@ -1,6 +1,6 @@
<?php <?php
declare(strict_types=1);
/* /*
* BudgetRepository.php * BudgetRepository.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -21,6 +21,9 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Repositories\Administration\Budget; namespace FireflyIII\Repositories\Administration\Budget;
use FireflyIII\Support\Repositories\Administration\AdministrationTrait; use FireflyIII\Support\Repositories\Administration\AdministrationTrait;

View File

@@ -1,6 +1,6 @@
<?php <?php
declare(strict_types=1);
/* /*
* BudgetRepositoryInterface.php * BudgetRepositoryInterface.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -21,6 +21,9 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Repositories\Administration\Budget; namespace FireflyIII\Repositories\Administration\Budget;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;

View File

@@ -1,6 +1,6 @@
<?php <?php
declare(strict_types=1);
/* /*
* OperationsRepository.php * OperationsRepository.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -21,6 +21,9 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Repositories\Administration\Budget; namespace FireflyIII\Repositories\Administration\Budget;
use Carbon\Carbon; use Carbon\Carbon;

View File

@@ -1,6 +1,6 @@
<?php <?php
declare(strict_types=1);
/* /*
* OperationsRepositoryInterface.php * OperationsRepositoryInterface.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -21,6 +21,9 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Repositories\Administration\Budget; namespace FireflyIII\Repositories\Administration\Budget;
use Carbon\Carbon; use Carbon\Carbon;
@@ -36,8 +39,8 @@ interface OperationsRepositoryInterface
* which have the specified budget set to them. It's grouped per currency, with as few details in the array * which have the specified budget set to them. It's grouped per currency, with as few details in the array
* as possible. Amounts are always negative. * as possible. Amounts are always negative.
* *
* @param Carbon $start * @param Carbon $start
* @param Carbon $end * @param Carbon $end
* @param Collection|null $accounts * @param Collection|null $accounts
* @param Collection|null $budgets * @param Collection|null $budgets
* *

View File

@@ -1,6 +1,6 @@
<?php <?php
declare(strict_types=1);
/* /*
* PiggyBankRepository.php * PiggyBankRepository.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -21,6 +21,9 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Repositories\Administration\PiggyBank; namespace FireflyIII\Repositories\Administration\PiggyBank;
use FireflyIII\Support\Repositories\Administration\AdministrationTrait; use FireflyIII\Support\Repositories\Administration\AdministrationTrait;

View File

@@ -1,6 +1,6 @@
<?php <?php
declare(strict_types=1);
/* /*
* PiggyBankRepositoryInterface.php * PiggyBankRepositoryInterface.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -21,6 +21,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Repositories\Administration\PiggyBank; namespace FireflyIII\Repositories\Administration\PiggyBank;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;

View File

@@ -1,4 +1,6 @@
<?php <?php
/* /*
* UserGroupRepository.php * UserGroupRepository.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -19,6 +21,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Repositories\UserGroup; namespace FireflyIII\Repositories\UserGroup;
use FireflyIII\Factory\UserGroupFactory; use FireflyIII\Factory\UserGroupFactory;

View File

@@ -1,4 +1,6 @@
<?php <?php
/* /*
* UserGroupRepositoryInterface.php * UserGroupRepositoryInterface.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -19,6 +21,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Repositories\UserGroup; namespace FireflyIII\Repositories\UserGroup;
use FireflyIII\User; use FireflyIII\User;

View File

@@ -1,6 +1,6 @@
<?php <?php
declare(strict_types=1);
/* /*
* CleansChartData.php * CleansChartData.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -21,6 +21,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Support\Http\Api; namespace FireflyIII\Support\Http\Api;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;

View File

@@ -1,6 +1,6 @@
<?php <?php
declare(strict_types=1);
/* /*
* ExchangeRateConverter.php * ExchangeRateConverter.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -21,6 +21,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Support\Http\Api; namespace FireflyIII\Support\Http\Api;
use Carbon\Carbon; use Carbon\Carbon;

View File

@@ -1,6 +1,6 @@
<?php <?php
declare(strict_types=1);
/* /*
* UrlValidator.php * UrlValidator.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -21,6 +21,8 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Support\Notifications; namespace FireflyIII\Support\Notifications;
/** /**

View File

@@ -175,7 +175,10 @@ class BillTransformer extends AbstractTransformer
'native_amount' => $this->converter->convert($currencies[$currencyId], $this->default, $journal->date, $transaction['amount']), 'native_amount' => $this->converter->convert($currencies[$currencyId], $this->default, $journal->date, $transaction['amount']),
'foreign_native_amount' => '' === (string)$transaction['foreign_amount'] ? null : $this->converter->convert( 'foreign_native_amount' => '' === (string)$transaction['foreign_amount'] ? null : $this->converter->convert(
$currencies[$foreignCurrencyId], $currencies[$foreignCurrencyId],
$this->default, $journal->date, $transaction['foreign_amount']), $this->default,
$journal->date,
$transaction['foreign_amount']
),
]; ];
} }
} }

View File

@@ -1,4 +1,6 @@
<?php <?php
/* /*
* UserGroupTransformer.php * UserGroupTransformer.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -19,6 +21,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Transformers\V2; namespace FireflyIII\Transformers\V2;
use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Enums\UserRoleEnum;

View File

@@ -406,30 +406,45 @@ class User extends Authenticatable
->whereIn('user_role_id', $dbRolesIds) ->whereIn('user_role_id', $dbRolesIds)
->where('user_group_id', $userGroup->id)->get(); ->where('user_group_id', $userGroup->id)->get();
if (0 === $groupMemberships->count()) { if (0 === $groupMemberships->count()) {
app('log')->error(sprintf('User #%d "%s" does not have roles %s in user group #%d "%s"', app('log')->error(sprintf(
$this->id, $this->email, 'User #%d "%s" does not have roles %s in user group #%d "%s"',
join(', ', $roles), $userGroup->id, $userGroup->title)); $this->id,
$this->email,
join(', ', $roles),
$userGroup->id,
$userGroup->title
));
return false; return false;
} }
foreach ($groupMemberships as $membership) { foreach ($groupMemberships as $membership) {
app('log')->debug(sprintf('User #%d "%s" has role "%s" in user group #%d "%s"', app('log')->debug(sprintf(
$this->id, $this->email, 'User #%d "%s" has role "%s" in user group #%d "%s"',
$membership->userRole->title, $userGroup->id, $userGroup->title)); $this->id,
if (in_array($membership->userRole->title, $dbRolesTitles)) { $this->email,
$membership->userRole->title,
$userGroup->id,
$userGroup->title
));
if (in_array($membership->userRole->title, $dbRolesTitles, true)) {
app('log')->debug(sprintf('Return true, found role "%s"', $membership->userRole->title)); app('log')->debug(sprintf('Return true, found role "%s"', $membership->userRole->title));
return true; return true;
} }
} }
app('log')->error(sprintf('User #%d "%s" does not have roles %s in user group #%d "%s"', app('log')->error(sprintf(
$this->id, $this->email, 'User #%d "%s" does not have roles %s in user group #%d "%s"',
join(', ', $roles), $userGroup->id, $userGroup->title)); $this->id,
$this->email,
join(', ', $roles),
$userGroup->id,
$userGroup->title
));
return false; return false;
// // not necessary, should always return true: // // not necessary, should always return true:
// $result = $groupMembership->userRole->title === $role->value; // $result = $groupMembership->userRole->title === $role->value;
// app('log')->error(sprintf('Does user #%d "%s" have role "%s" in user group #%d "%s"? %s', // app('log')->error(sprintf('Does user #%d "%s" have role "%s" in user group #%d "%s"? %s',
// $this->id, $this->email, // $this->id, $this->email,
// $role->value, $userGroup->id, $userGroup->title, var_export($result, true))); // $role->value, $userGroup->id, $userGroup->title, var_export($result, true)));
// return $result; // return $result;
} }
/** /**
@@ -666,7 +681,7 @@ class User extends Authenticatable
*/ */
public function userGroup(): BelongsTo public function userGroup(): BelongsTo
{ {
return $this->belongsTo(UserGroup::class,); return $this->belongsTo(UserGroup::class, );
} }
/** /**

View File

@@ -33,8 +33,8 @@ $app = require_once __DIR__.'/bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class); $kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$status = $kernel->handle( $status = $kernel->handle(
$input = new Symfony\Component\Console\Input\ArgvInput, $input = new Symfony\Component\Console\Input\ArgvInput(),
new Symfony\Component\Console\Output\ConsoleOutput new Symfony\Component\Console\Output\ConsoleOutput()
); );
/* /*

View File

@@ -1,5 +1,26 @@
<?php <?php
/*
* cors.php
* Copyright (c) 2023 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1); declare(strict_types=1);
return [ return [

View File

@@ -1,5 +1,26 @@
<?php <?php
/*
* hashing.php
* Copyright (c) 2023 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1); declare(strict_types=1);
return [ return [

View File

@@ -1,5 +1,26 @@
<?php <?php
/*
* 2023_08_11_192521_upgrade_og_table.php
* Copyright (c) 2023 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1); declare(strict_types=1);
use Doctrine\DBAL\Schema\Exception\ColumnDoesNotExist; use Doctrine\DBAL\Schema\Exception\ColumnDoesNotExist;

View File

@@ -1 +1,21 @@
<!DOCTYPE html><html><head><base href=/v3/ ><title>Firefly III</title><meta charset=utf-8><meta content="Personal finances manager" name=description><meta content="telephone=no" name=format-detection><meta content=no name=msapplication-tap-highlight><meta content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width" name=viewport><link href=favicon-32x32.png rel=icon sizes=32x32 type=image/png><link href=favicon-16x16.png rel=icon sizes=16x16 type=image/png><link href=maskable76.png rel=apple-touch-icon sizes=76x76><link href=maskable120.png rel=apple-touch-icon sizes=120x120><link href=maskable152.png rel=apple-touch-icon sizes=152x152><link href=apple-touch-icon.png rel=apple-touch-icon sizes=180x180><link color=#3c8dbc href=safari-pinned-tab.svg rel=mask-icon><link href=maskable192.png rel=icon sizes=192x192><link href=maskable128.png rel=icon sizes=128x128><link href=manifest.webmanifest rel=manifest><meta content=#1e6581 name=msapplication-TileColor><meta content=maskable512.png name=msapplication-TileImage><meta content=no name=msapplication-tap-highlight><meta content="Firefly III" name=application-name><meta content="noindex, nofollow, noarchive, noodp, NoImageIndex, noydir" name=robots><meta content=yes name=apple-mobile-web-app-capable><meta content="Firefly III" name=apple-mobile-web-app-title><meta content="Firefly III" name=application-name><meta content=#3c8dbc name=msapplication-TileColor><meta content="mstile-144x144.png?v=3e8AboOwbd" name=msapplication-TileImage><meta content=#3c8dbc name=theme-color><script defer src=/v3/js/vendor.fa245dad.js></script><script defer src=/v3/js/app.d0f06e34.js></script><link href=/v3/css/vendor.deebbe65.css rel=stylesheet><link href=/v3/css/app.50c7ba73.css rel=stylesheet></head><body><div id=q-app></div></body></html> <!--
~ index.html
~ Copyright (c) 2023 james@firefly-iii.org
~
~ This file is part of Firefly III (https://github.com/firefly-iii).
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU Affero General Public License as
~ published by the Free Software Foundation, either version 3 of the
~ License, or (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU Affero General Public License for more details.
~
~ You should have received a copy of the GNU Affero General Public License
~ along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<!DOCTYPE html><html><head><base href=/v3/ ><title>Firefly III</title><meta charset=utf-8><meta content="Personal finances manager" name=description><meta content="telephone=no" name=format-detection><meta content=no name=msapplication-tap-highlight><meta content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width" name=viewport><link href=favicon-32x32.png rel=icon sizes=32x32 type=image/png><link href=favicon-16x16.png rel=icon sizes=16x16 type=image/png><link href=maskable76.png rel=apple-touch-icon sizes=76x76><link href=maskable120.png rel=apple-touch-icon sizes=120x120><link href=maskable152.png rel=apple-touch-icon sizes=152x152><link href=apple-touch-icon.png rel=apple-touch-icon sizes=180x180><link color=#3c8dbc href=safari-pinned-tab.svg rel=mask-icon><link href=maskable192.png rel=icon sizes=192x192><link href=maskable128.png rel=icon sizes=128x128><link href=manifest.webmanifest rel=manifest><meta content=#1e6581 name=msapplication-TileColor><meta content=maskable512.png name=msapplication-TileImage><meta content=no name=msapplication-tap-highlight><meta content="Firefly III" name=application-name><meta content="noindex, nofollow, noarchive, noodp, NoImageIndex, noydir" name=robots><meta content=yes name=apple-mobile-web-app-capable><meta content="Firefly III" name=apple-mobile-web-app-title><meta content="Firefly III" name=application-name><meta content=#3c8dbc name=msapplication-TileColor><meta content="mstile-144x144.png?v=3e8AboOwbd" name=msapplication-TileImage><meta content=#3c8dbc name=theme-color><script defer src=/v3/js/vendor.fa245dad.js></script><script defer src=/v3/js/app.d0f06e34.js></script><link href=/v3/css/vendor.deebbe65.css rel=stylesheet><link href=/v3/css/app.50c7ba73.css rel=stylesheet></head><body><div id=q-app></div></body></html>

View File

@@ -1,3 +1,23 @@
/*
* dates.js
* Copyright (c) 2023 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { import {
addMonths, addMonths,
endOfDay, endOfDay,

View File

@@ -1,3 +1,23 @@
/*
* get-viewrange.js
* Copyright (c) 2023 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { import {
endOfDay, endOfMonth, endOfQuarter, endOfDay, endOfMonth, endOfQuarter,
endOfWeek, endOfWeek,

View File

@@ -1,6 +1,6 @@
<?php <?php
declare(strict_types=1);
/* /*
* rules.php * rules.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -21,6 +21,7 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
return [ return [
'main_message' => 'Action ":action", present in rule ":rule", could not be applied to transaction #:group: :error', 'main_message' => 'Action ":action", present in rule ":rule", could not be applied to transaction #:group: :error',

View File

@@ -1,3 +1,23 @@
/*
* vite.config.js
* Copyright (c) 2023 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {defineConfig} from 'vite'; import {defineConfig} from 'vite';
import laravel from 'laravel-vite-plugin'; import laravel from 'laravel-vite-plugin';
import manifestSRI from 'vite-plugin-manifest-sri'; import manifestSRI from 'vite-plugin-manifest-sri';