Code cleanup

This commit is contained in:
James Cole
2023-09-21 11:32:56 +02:00
parent 724a16944a
commit 417b7c3f86
19 changed files with 82 additions and 57 deletions

View File

@@ -35,9 +35,9 @@ use Illuminate\Foundation\Http\FormRequest;
*/ */
class StoreRequest extends FormRequest class StoreRequest extends FormRequest
{ {
protected array $acceptedRoles = [UserRoleEnum::OWNER, UserRoleEnum::FULL];
use ChecksLogin; use ChecksLogin;
use ConvertsDataTypes; use ConvertsDataTypes;
protected array $acceptedRoles = [UserRoleEnum::OWNER, UserRoleEnum::FULL];
/** /**
* @return array * @return array

View File

@@ -35,9 +35,9 @@ use Illuminate\Foundation\Http\FormRequest;
*/ */
class UpdateMembershipRequest extends FormRequest class UpdateMembershipRequest extends FormRequest
{ {
protected array $acceptedRoles = [UserRoleEnum::OWNER, UserRoleEnum::FULL];
use ChecksLogin; use ChecksLogin;
use ConvertsDataTypes; use ConvertsDataTypes;
protected array $acceptedRoles = [UserRoleEnum::OWNER, UserRoleEnum::FULL];
/** /**
* @return array * @return array

View File

@@ -36,9 +36,9 @@ use Illuminate\Foundation\Http\FormRequest;
*/ */
class UpdateRequest extends FormRequest class UpdateRequest extends FormRequest
{ {
protected array $acceptedRoles = [UserRoleEnum::OWNER, UserRoleEnum::FULL];
use ChecksLogin; use ChecksLogin;
use ConvertsDataTypes; use ConvertsDataTypes;
protected array $acceptedRoles = [UserRoleEnum::OWNER, UserRoleEnum::FULL];
/** /**
* @return array * @return array

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* AttachmentObserver.php * AttachmentObserver.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -18,6 +19,7 @@
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Handlers\Observer; namespace FireflyIII\Handlers\Observer;

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* BillObserver.php * BillObserver.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -18,6 +19,7 @@
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Handlers\Observer; namespace FireflyIII\Handlers\Observer;

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* BudgetObserver.php * BudgetObserver.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -18,6 +19,7 @@
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Handlers\Observer; namespace FireflyIII\Handlers\Observer;

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* CategoryObserver.php * CategoryObserver.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -18,6 +19,7 @@
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Handlers\Observer; namespace FireflyIII\Handlers\Observer;

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* RecurrenceObserver.php * RecurrenceObserver.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -18,6 +19,7 @@
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Handlers\Observer; namespace FireflyIII\Handlers\Observer;

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* RecurrenceTransactionObserver.php * RecurrenceTransactionObserver.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -18,6 +19,7 @@
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Handlers\Observer; namespace FireflyIII\Handlers\Observer;

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* RuleGroupObserver.php * RuleGroupObserver.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -18,6 +19,7 @@
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Handlers\Observer; namespace FireflyIII\Handlers\Observer;

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* RuleObserver.php * RuleObserver.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -18,6 +19,7 @@
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Handlers\Observer; namespace FireflyIII\Handlers\Observer;

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* TagObserver.php * TagObserver.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -18,6 +19,7 @@
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Handlers\Observer; namespace FireflyIII\Handlers\Observer;

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* TransactionGroup.php * TransactionGroup.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -18,6 +19,7 @@
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Handlers\Observer; namespace FireflyIII\Handlers\Observer;

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* TransactionJournalObserver.php * TransactionJournalObserver.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -18,6 +19,7 @@
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Handlers\Observer; namespace FireflyIII\Handlers\Observer;

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* TransactionObserver.php * TransactionObserver.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -18,6 +19,7 @@
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Handlers\Observer; namespace FireflyIII\Handlers\Observer;

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* WebhookMessageObserver.php * WebhookMessageObserver.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -18,10 +19,10 @@
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Handlers\Observer; namespace FireflyIII\Handlers\Observer;
use FireflyIII\Models\Webhook;
use FireflyIII\Models\WebhookMessage; use FireflyIII\Models\WebhookMessage;
/** /**
@@ -29,7 +30,6 @@ use FireflyIII\Models\WebhookMessage;
*/ */
class WebhookMessageObserver class WebhookMessageObserver
{ {
/** /**
* @param WebhookMessage $webhookMessage * @param WebhookMessage $webhookMessage
* *

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* WebhookObserver.php * WebhookObserver.php
* Copyright (c) 2023 james@firefly-iii.org * Copyright (c) 2023 james@firefly-iii.org
@@ -18,6 +19,7 @@
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Handlers\Observer; namespace FireflyIII\Handlers\Observer;

View File

@@ -111,7 +111,7 @@ class CurrencyExchangeRate extends Model
protected function rate(): Attribute protected function rate(): Attribute
{ {
return Attribute::make( return Attribute::make(
get: fn($value) => (string)$value, get: fn ($value) => (string)$value,
); );
} }
@@ -121,7 +121,7 @@ class CurrencyExchangeRate extends Model
protected function userRate(): Attribute protected function userRate(): Attribute
{ {
return Attribute::make( return Attribute::make(
get: fn($value) => (string)$value, get: fn ($value) => (string)$value,
); );
} }
} }

99
composer.lock generated
View File

@@ -1939,16 +1939,16 @@
}, },
{ {
"name": "laravel/framework", "name": "laravel/framework",
"version": "v10.23.1", "version": "v10.24.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/framework.git", "url": "https://github.com/laravel/framework.git",
"reference": "dbfd495557678759153e8d71cc2f6027686ca51e" "reference": "bcebd0a4c015d5c38aeec299d355a42451dd3726"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/dbfd495557678759153e8d71cc2f6027686ca51e", "url": "https://api.github.com/repos/laravel/framework/zipball/bcebd0a4c015d5c38aeec299d355a42451dd3726",
"reference": "dbfd495557678759153e8d71cc2f6027686ca51e", "reference": "bcebd0a4c015d5c38aeec299d355a42451dd3726",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2135,7 +2135,7 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "source": "https://github.com/laravel/framework"
}, },
"time": "2023-09-13T14:51:46+00:00" "time": "2023-09-19T15:25:04+00:00"
}, },
{ {
"name": "laravel/passport", "name": "laravel/passport",
@@ -2217,16 +2217,16 @@
}, },
{ {
"name": "laravel/prompts", "name": "laravel/prompts",
"version": "v0.1.7", "version": "v0.1.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/prompts.git", "url": "https://github.com/laravel/prompts.git",
"reference": "554e7d855a22e87942753d68e23b327ad79b2070" "reference": "68dcc65babf92e1fb43cba0b3f78fc3d8002709c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/prompts/zipball/554e7d855a22e87942753d68e23b327ad79b2070", "url": "https://api.github.com/repos/laravel/prompts/zipball/68dcc65babf92e1fb43cba0b3f78fc3d8002709c",
"reference": "554e7d855a22e87942753d68e23b327ad79b2070", "reference": "68dcc65babf92e1fb43cba0b3f78fc3d8002709c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2259,9 +2259,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/laravel/prompts/issues", "issues": "https://github.com/laravel/prompts/issues",
"source": "https://github.com/laravel/prompts/tree/v0.1.7" "source": "https://github.com/laravel/prompts/tree/v0.1.8"
}, },
"time": "2023-09-12T11:09:22+00:00" "time": "2023-09-19T15:33:56+00:00"
}, },
{ {
"name": "laravel/sanctum", "name": "laravel/sanctum",
@@ -3848,16 +3848,16 @@
}, },
{ {
"name": "nette/utils", "name": "nette/utils",
"version": "v4.0.1", "version": "v4.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/nette/utils.git", "url": "https://github.com/nette/utils.git",
"reference": "9124157137da01b1f5a5a22d6486cb975f26db7e" "reference": "cead6637226456b35e1175cc53797dd585d85545"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nette/utils/zipball/9124157137da01b1f5a5a22d6486cb975f26db7e", "url": "https://api.github.com/repos/nette/utils/zipball/cead6637226456b35e1175cc53797dd585d85545",
"reference": "9124157137da01b1f5a5a22d6486cb975f26db7e", "reference": "cead6637226456b35e1175cc53797dd585d85545",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -3879,8 +3879,7 @@
"ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()",
"ext-json": "to use Nette\\Utils\\Json", "ext-json": "to use Nette\\Utils\\Json",
"ext-mbstring": "to use Strings::lower() etc...", "ext-mbstring": "to use Strings::lower() etc...",
"ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()", "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()"
"ext-xml": "to use Strings::length() etc. when mbstring is not available"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@@ -3929,43 +3928,43 @@
], ],
"support": { "support": {
"issues": "https://github.com/nette/utils/issues", "issues": "https://github.com/nette/utils/issues",
"source": "https://github.com/nette/utils/tree/v4.0.1" "source": "https://github.com/nette/utils/tree/v4.0.2"
}, },
"time": "2023-07-30T15:42:21+00:00" "time": "2023-09-19T11:58:07+00:00"
}, },
{ {
"name": "nunomaduro/collision", "name": "nunomaduro/collision",
"version": "v7.8.1", "version": "v7.9.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/nunomaduro/collision.git", "url": "https://github.com/nunomaduro/collision.git",
"reference": "61553ad3260845d7e3e49121b7074619233d361b" "reference": "296d0cf9fe462837ac0da8a568b56fc026b132da"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nunomaduro/collision/zipball/61553ad3260845d7e3e49121b7074619233d361b", "url": "https://api.github.com/repos/nunomaduro/collision/zipball/296d0cf9fe462837ac0da8a568b56fc026b132da",
"reference": "61553ad3260845d7e3e49121b7074619233d361b", "reference": "296d0cf9fe462837ac0da8a568b56fc026b132da",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"filp/whoops": "^2.15.3", "filp/whoops": "^2.15.3",
"nunomaduro/termwind": "^1.15.1", "nunomaduro/termwind": "^1.15.1",
"php": "^8.1.0", "php": "^8.1.0",
"symfony/console": "^6.3.2" "symfony/console": "^6.3.4"
}, },
"require-dev": { "require-dev": {
"brianium/paratest": "^7.2.4", "brianium/paratest": "^7.2.7",
"laravel/framework": "^10.17.1", "laravel/framework": "^10.23.1",
"laravel/pint": "^1.10.5", "laravel/pint": "^1.13.1",
"laravel/sail": "^1.23.1", "laravel/sail": "^1.25.0",
"laravel/sanctum": "^3.2.5", "laravel/sanctum": "^3.3.1",
"laravel/tinker": "^2.8.1", "laravel/tinker": "^2.8.2",
"nunomaduro/larastan": "^2.6.4", "nunomaduro/larastan": "^2.6.4",
"orchestra/testbench-core": "^8.5.9", "orchestra/testbench-core": "^8.11.0",
"pestphp/pest": "^2.12.1", "pestphp/pest": "^2.19.1",
"phpunit/phpunit": "^10.3.1", "phpunit/phpunit": "^10.3.5",
"sebastian/environment": "^6.0.1", "sebastian/environment": "^6.0.1",
"spatie/laravel-ignition": "^2.2.0" "spatie/laravel-ignition": "^2.3.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@@ -4024,7 +4023,7 @@
"type": "patreon" "type": "patreon"
} }
], ],
"time": "2023-08-07T08:03:21+00:00" "time": "2023-09-19T10:45:09+00:00"
}, },
{ {
"name": "nunomaduro/termwind", "name": "nunomaduro/termwind",
@@ -5630,16 +5629,16 @@
}, },
{ {
"name": "spatie/ignition", "name": "spatie/ignition",
"version": "1.10.1", "version": "1.11.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/spatie/ignition.git", "url": "https://github.com/spatie/ignition.git",
"reference": "d92b9a081e99261179b63a858c7a4b01541e7dd1" "reference": "48b23411ca4bfbc75c75dfc638b6b36159c375aa"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/spatie/ignition/zipball/d92b9a081e99261179b63a858c7a4b01541e7dd1", "url": "https://api.github.com/repos/spatie/ignition/zipball/48b23411ca4bfbc75c75dfc638b6b36159c375aa",
"reference": "d92b9a081e99261179b63a858c7a4b01541e7dd1", "reference": "48b23411ca4bfbc75c75dfc638b6b36159c375aa",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -5709,7 +5708,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-08-21T15:06:37+00:00" "time": "2023-09-19T15:29:52+00:00"
}, },
{ {
"name": "spatie/laravel-html", "name": "spatie/laravel-html",
@@ -9919,16 +9918,16 @@
}, },
{ {
"name": "phpmyadmin/sql-parser", "name": "phpmyadmin/sql-parser",
"version": "5.8.1", "version": "5.8.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpmyadmin/sql-parser.git", "url": "https://github.com/phpmyadmin/sql-parser.git",
"reference": "b877ee6262a00f0f498da5e01335e8a5dc01d203" "reference": "f1720ae19abe6294cb5599594a8a57bc3c8cc287"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpmyadmin/sql-parser/zipball/b877ee6262a00f0f498da5e01335e8a5dc01d203", "url": "https://api.github.com/repos/phpmyadmin/sql-parser/zipball/f1720ae19abe6294cb5599594a8a57bc3c8cc287",
"reference": "b877ee6262a00f0f498da5e01335e8a5dc01d203", "reference": "f1720ae19abe6294cb5599594a8a57bc3c8cc287",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -10002,7 +10001,7 @@
"type": "other" "type": "other"
} }
], ],
"time": "2023-09-15T18:21:22+00:00" "time": "2023-09-19T12:34:29+00:00"
}, },
{ {
"name": "phpstan/phpdoc-parser", "name": "phpstan/phpdoc-parser",
@@ -10053,16 +10052,16 @@
}, },
{ {
"name": "phpstan/phpstan", "name": "phpstan/phpstan",
"version": "1.10.34", "version": "1.10.35",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan.git", "url": "https://github.com/phpstan/phpstan.git",
"reference": "7f806b6f1403e6914c778140e2ba07c293cb4901" "reference": "e730e5facb75ffe09dfb229795e8c01a459f26c3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/7f806b6f1403e6914c778140e2ba07c293cb4901", "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e730e5facb75ffe09dfb229795e8c01a459f26c3",
"reference": "7f806b6f1403e6914c778140e2ba07c293cb4901", "reference": "e730e5facb75ffe09dfb229795e8c01a459f26c3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -10111,7 +10110,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-09-13T09:49:47+00:00" "time": "2023-09-19T15:27:56+00:00"
}, },
{ {
"name": "phpstan/phpstan-deprecation-rules", "name": "phpstan/phpstan-deprecation-rules",