Skip to content

Firefly III: a personal finances manager

Removed last phpstan errors

James Cole2c997d8d9523
diff --git a/.ci/phpstan.neon b/.ci/phpstan.neon
index bf3cd4402c..b34338d95d 100644
--- a/.ci/phpstan.neon
+++ b/.ci/phpstan.neon
@@ -24,6 +24,8 @@ parameters:
enabled: false
noNamedArgument:
enabled: false
+ noParameterWithContainerTypeDeclaration:
+ enabled: false
paths:
- ../app
- ../database
@@ -36,6 +38,17 @@ parameters:
reportUnmatchedIgnoredErrors: true
ignoreErrors:
# these are actually interesting but not right now:
+ - identifier: staticMethod.dynamicCall
+ - identifier: argument.templateType
+ - identifier: method.childReturnType
+ - identifier: instanceof.alwaysFalse
+ - identifier: deadCode.unreachable
+ - identifier: method.dynamicName
+ - identifier: larastan.noEnvCallsOutsideOfConfig
+ - identifier: property.notFound
+ - identifier: arguments.count
+ - identifier: staticMethod.dynamicName
+ - identifier: catch.neverThrown
- identifier: notIdentical.alwaysTrue
- identifier: method.notFound
- identifier: nullsafe.neverNull
@@ -90,7 +103,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
diff --git a/app/Support/NullArrayObject.php b/app/Support/NullArrayObject.php
index 58287c2edb..8ee0a9d190 100644
--- a/app/Support/NullArrayObject.php
+++ b/app/Support/NullArrayObject.php
@@ -36,7 +36,6 @@ class NullArrayObject extends ArrayObject
*
* @param null $default
*/
- /** @phpstan-ignore-next-line */
public function __construct(
array $array,
public $default = null
diff --git a/bootstrap/app.php b/bootstrap/app.php
index 77fe016638..aee465e95a 100644
--- a/bootstrap/app.php
+++ b/bootstrap/app.php
@@ -70,7 +70,7 @@ if (!function_exists('envNonEmpty')) {
*/
function envNonEmpty(string $key, string | int | bool | null $default = null)
{
- $result = env($key, $default); // @phpstan-ignore-line
+ $result = env($key, $default);
if ('' === $result) {
return $default;
}
diff --git a/bootstrap/providers.php b/bootstrap/providers.php
index a63070499f..fc631e6463 100644
--- a/bootstrap/providers.php
+++ b/bootstrap/providers.php
@@ -19,6 +19,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+declare(strict_types=1);
+
use FireflyIII\Providers\AccountServiceProvider;
use FireflyIII\Providers\AdminServiceProvider;
use FireflyIII\Providers\AppServiceProvider;
diff --git a/database/seeders/TransactionTypeSeeder.php b/database/seeders/TransactionTypeSeeder.php
index 7ac74ff8dc..7f82a82709 100644
--- a/database/seeders/TransactionTypeSeeder.php
+++ b/database/seeders/TransactionTypeSeeder.php
@@ -37,7 +37,7 @@ class TransactionTypeSeeder extends Seeder
public function run(): void
{
/** @var TransactionTypeEnum $type */
- foreach (TransactionTypeEnum::cases() as $type) { // @phpstan-ignore-line
+ foreach (TransactionTypeEnum::cases() as $type) {
if (null === TransactionType::where('type', $type->value)->first()) {
try {
TransactionType::create(['type' => $type->value]);
diff --git a/database/seeders/UserRoleSeeder.php b/database/seeders/UserRoleSeeder.php
index 65c0408a65..342fefaf94 100644
--- a/database/seeders/UserRoleSeeder.php
+++ b/database/seeders/UserRoleSeeder.php
@@ -41,7 +41,7 @@ class UserRoleSeeder extends Seeder
public function run(): void
{
/** @var UserRoleEnum $role */
- foreach (UserRoleEnum::cases() as $role) { // @phpstan-ignore-line
+ foreach (UserRoleEnum::cases() as $role) {
if (null === UserRole::where('title', $role->value)->first()) {
try {
UserRole::create(['title' => $role->value]);