diff --git a/.ci/phpstan.neon b/.ci/phpstan.neon index 856e2a9abf..34b8841ce3 100644 --- a/.ci/phpstan.neon +++ b/.ci/phpstan.neon @@ -16,6 +16,8 @@ parameters: - '#Dynamic call to static method#' # all the Laravel ORM things depend on this. - identifier: varTag.nativeType - identifier: varTag.type + - identifier: missingType.iterableValue # not interesting enough to fix. + - identifier: missingType.generics # not interesting enough to fix. # phpstan can't handle this so we ignore them. - '#Call to an undefined method Illuminate\\Database\\Eloquent\\Relations\\HasMany::before#' @@ -69,5 +71,5 @@ parameters: # The level 8 is the highest level. original was 5 # 7 is more than enough, higher just leaves NULL things. - level: 5 + level: 6 diff --git a/app/Notifications/User/UserRegistration.php b/app/Notifications/User/UserRegistration.php index bcc8947993..9ab267fef1 100644 --- a/app/Notifications/User/UserRegistration.php +++ b/app/Notifications/User/UserRegistration.php @@ -41,7 +41,7 @@ class UserRegistration extends Notification /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ - public function toArray(User $notifiable) + public function toArray(User $notifiable): array { return [ ]; @@ -50,7 +50,7 @@ class UserRegistration extends Notification /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ - public function toMail(User $notifiable) + public function toMail(User $notifiable): MailMessage { return (new MailMessage()) ->markdown('emails.registered', ['address' => route('index')]) @@ -61,7 +61,7 @@ class UserRegistration extends Notification /** * @SuppressWarnings("PHPMD.UnusedFormalParameter") */ - public function via(User $notifiable) + public function via(User $notifiable): array { // other settings will not be available at this point anyway. return ['mail']; diff --git a/app/Support/FireflyConfig.php b/app/Support/FireflyConfig.php index e44549dbd7..a9e182b519 100644 --- a/app/Support/FireflyConfig.php +++ b/app/Support/FireflyConfig.php @@ -49,7 +49,7 @@ class FireflyConfig return 1 === Configuration::where('name', $name)->count(); } - public function getEncrypted(string $name, $default = null): ?Configuration + public function getEncrypted(string $name, mixed $default = null): ?Configuration { $result = $this->get($name, $default); if (null === $result) { @@ -77,7 +77,7 @@ class FireflyConfig * * @throws FireflyException */ - public function get(string $name, $default = null): ?Configuration + public function get(string $name, mixed $default = null): ?Configuration { $fullName = 'ff-config-'.$name; if (\Cache::has($fullName)) { @@ -133,10 +133,7 @@ class FireflyConfig return $config; } - /** - * @param mixed $default - */ - public function getFresh(string $name, $default = null): ?Configuration + public function getFresh(string $name, mixed $default = null): ?Configuration { $config = Configuration::where('name', $name)->first(['id', 'name', 'data']); if (null !== $config) { diff --git a/app/Support/Form/FormSupport.php b/app/Support/Form/FormSupport.php index 62978ac598..06d50030ff 100644 --- a/app/Support/Form/FormSupport.php +++ b/app/Support/Form/FormSupport.php @@ -34,7 +34,7 @@ use Illuminate\Support\MessageBag; */ trait FormSupport { - public function multiSelect(string $name, ?array $list = null, $selected = null, ?array $options = null): string + public function multiSelect(string $name, ?array $list = null, mixed $selected = null, ?array $options = null): string { $list ??= []; $label = $this->label($name, $options);