More PHP8.4 updates

This commit is contained in:
James Cole
2025-05-04 13:47:00 +02:00
parent e42107c03c
commit 51e86448c7
195 changed files with 524 additions and 715 deletions

View File

@@ -45,6 +45,7 @@ class AccountServiceProvider extends ServiceProvider
/**
* Register the application services.
*/
#[\Override]
public function register(): void
{
$this->registerRepository();

View File

@@ -41,6 +41,7 @@ class AdminServiceProvider extends ServiceProvider
/**
* Register the application services.
*/
#[\Override]
public function register(): void
{
$this->linkType();

View File

@@ -86,6 +86,7 @@ class AppServiceProvider extends ServiceProvider
/**
* Register any application services.
*/
#[\Override]
public function register(): void
{
Passport::ignoreRoutes();

View File

@@ -41,6 +41,7 @@ class AttachmentServiceProvider extends ServiceProvider
/**
* Register the application services.
*/
#[\Override]
public function register(): void
{
$this->app->bind(

View File

@@ -48,16 +48,12 @@ class AuthServiceProvider extends ServiceProvider
{
Auth::provider(
'remote_user_provider',
static function ($app, array $config) {
return new RemoteUserProvider();
}
static fn($app, array $config) => new RemoteUserProvider()
);
Auth::extend(
'remote_user_guard',
static function ($app, string $name, array $config) {
return new RemoteUserGuard(Auth::createUserProvider($config['provider']), $app);
}
static fn($app, string $name, array $config) => new RemoteUserGuard(Auth::createUserProvider($config['provider']), $app)
);
Passport::tokensExpireIn(now()->addDays(14));

View File

@@ -41,6 +41,7 @@ class BillServiceProvider extends ServiceProvider
/**
* Register the application services.
*/
#[\Override]
public function register(): void
{
$this->app->bind(

View File

@@ -51,6 +51,7 @@ class BudgetServiceProvider extends ServiceProvider
*
* @SuppressWarnings("PHPMD.ExcessiveMethodLength")
*/
#[\Override]
public function register(): void
{
// reference to auth is not understood by phpstan.

View File

@@ -45,6 +45,7 @@ class CategoryServiceProvider extends ServiceProvider
/**
* Register the application services.
*/
#[\Override]
public function register(): void
{
// phpstan does not understand reference to 'auth'.

View File

@@ -45,6 +45,7 @@ class CurrencyServiceProvider extends ServiceProvider
/**
* Register the application services.
*/
#[\Override]
public function register(): void
{
$this->app->bind(

View File

@@ -260,6 +260,7 @@ class EventServiceProvider extends ServiceProvider
/**
* Register any events for your application.
*/
#[\Override]
public function boot(): void
{
$this->registerObservers();

View File

@@ -90,9 +90,7 @@ class FireflyServiceProvider extends ServiceProvider
public function boot(): void
{
Validator::resolver(
static function ($translator, $data, $rules, $messages) {
return new FireflyValidator($translator, $data, $rules, $messages);
}
static fn($translator, $data, $rules, $messages) => new FireflyValidator($translator, $data, $rules, $messages)
);
}
@@ -101,78 +99,57 @@ class FireflyServiceProvider extends ServiceProvider
*
* @SuppressWarnings("PHPMD.ExcessiveMethodLength")
*/
#[\Override]
public function register(): void
{
$this->app->bind(
'preferences',
static function () {
return new Preferences();
}
static fn() => new Preferences()
);
$this->app->bind(
'fireflyconfig',
static function () {
return new FireflyConfig();
}
static fn() => new FireflyConfig()
);
$this->app->bind(
'navigation',
static function () {
return new Navigation();
}
static fn() => new Navigation()
);
$this->app->bind(
'amount',
static function () {
return new Amount();
}
static fn() => new Amount()
);
$this->app->bind(
'steam',
static function () {
return new Steam();
}
static fn() => new Steam()
);
$this->app->bind(
'balance',
static function () {
return new Balance();
}
static fn() => new Balance()
);
$this->app->bind(
'expandedform',
static function () {
return new ExpandedForm();
}
static fn() => new ExpandedForm()
);
$this->app->bind(
'accountform',
static function () {
return new AccountForm();
}
static fn() => new AccountForm()
);
$this->app->bind(
'currencyform',
static function () {
return new CurrencyForm();
}
static fn() => new CurrencyForm()
);
$this->app->bind(
'piggybankform',
static function () {
return new PiggyBankForm();
}
static fn() => new PiggyBankForm()
);
$this->app->bind(
'ruleform',
static function () {
return new RuleForm();
}
static fn() => new RuleForm()
);
// chart generator:

View File

@@ -35,6 +35,7 @@ class FireflySessionProvider extends ServiceProvider
/**
* Register the service provider.
*/
#[\Override]
public function register(): void
{
$this->registerSessionManager();
@@ -51,9 +52,7 @@ class FireflySessionProvider extends ServiceProvider
{
$this->app->singleton(
'session',
static function ($app) {
return new SessionManager($app);
}
static fn($app) => new SessionManager($app)
);
}
@@ -64,12 +63,11 @@ class FireflySessionProvider extends ServiceProvider
{
$this->app->singleton(
'session.store',
static function ($app) {
static fn($app) =>
// First, we will create the session manager which is responsible for the
// creation of the various session drivers when they are needed by the
// application instance, and will resolve them on a lazy load basis.
return $app->make('session')->driver();
}
$app->make('session')->driver()
);
}
}

View File

@@ -49,6 +49,7 @@ class JournalServiceProvider extends ServiceProvider
/**
* Register the application services.
*/
#[\Override]
public function register(): void
{
$this->registerRepository();

View File

@@ -41,6 +41,7 @@ class PiggyBankServiceProvider extends ServiceProvider
/**
* Register the application services.
*/
#[\Override]
public function register(): void
{
$this->app->bind(

View File

@@ -41,6 +41,7 @@ class RecurringServiceProvider extends ServiceProvider
/**
* Register the application services.
*/
#[\Override]
public function register(): void
{
$this->app->bind(

View File

@@ -37,6 +37,7 @@ class RouteServiceProvider extends ServiceProvider
/**
* Define the routes for the application.
*/
#[\Override]
public function boot(): void
{
$this->routes(function (): void {

View File

@@ -41,6 +41,7 @@ class RuleGroupServiceProvider extends ServiceProvider
/**
* Register the application services.
*/
#[\Override]
public function register(): void
{
$this->app->bind(

View File

@@ -41,6 +41,7 @@ class RuleServiceProvider extends ServiceProvider
/**
* Register the application services.
*/
#[\Override]
public function register(): void
{
$this->app->bind(

View File

@@ -44,6 +44,7 @@ class SearchServiceProvider extends ServiceProvider
/**
* Register the application services.
*/
#[\Override]
public function register(): void
{
$this->app->bind(

View File

@@ -34,6 +34,7 @@ class SessionServiceProvider extends BaseSessionServiceProvider
/**
* Register the service provider.
*/
#[\Override]
public function register(): void
{
$this->registerSessionManager();

View File

@@ -43,6 +43,7 @@ class TagServiceProvider extends ServiceProvider
/**
* Register the application services.
*/
#[\Override]
public function register(): void
{
$this->app->bind(