Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Jan 10, 2024
1 parent 83fe630 commit b058d25
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 100 deletions.
6 changes: 2 additions & 4 deletions src/CanvasServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ class CanvasServiceProvider extends ServiceProvider implements DeferrableProvide
*/
public function register(): void
{
$this->callAfterResolving(PresetManager::class, function ($manager, $app) {
$manager->extend('canvas', function ($app) {
return new GeneratorPreset($app);
});
$this->callAfterResolving(PresetManager::class, static function ($manager, $app) {
$manager->extend('canvas', static fn ($app) => new GeneratorPreset($app));

$manager->setDefaultDriver('canvas');
});
Expand Down
128 changes: 32 additions & 96 deletions src/LaravelServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ public function register()
*/
protected function registerCastMakeCommand()
{
$this->app->singleton(CastMakeCommand::class, static function ($app) {
return new Console\CastMakeCommand($app['files']);
});
$this->app->singleton(CastMakeCommand::class, static fn ($app) => new Console\CastMakeCommand($app['files']));
}

/**
Expand All @@ -139,9 +137,7 @@ protected function registerCastMakeCommand()
*/
protected function registerChannelMakeCommand()
{
$this->app->singleton(ChannelMakeCommand::class, static function ($app) {
return new Console\ChannelMakeCommand($app['files']);
});
$this->app->singleton(ChannelMakeCommand::class, static fn ($app) => new Console\ChannelMakeCommand($app['files']));
}

/**
Expand All @@ -151,9 +147,7 @@ protected function registerChannelMakeCommand()
*/
protected function registerComponentMakeCommand()
{
$this->app->singleton(ComponentMakeCommand::class, static function ($app) {
return new Console\ComponentMakeCommand($app['files']);
});
$this->app->singleton(ComponentMakeCommand::class, static fn ($app) => new Console\ComponentMakeCommand($app['files']));
}

/**
Expand All @@ -163,9 +157,7 @@ protected function registerComponentMakeCommand()
*/
protected function registerConsoleMakeCommand()
{
$this->app->singleton(ConsoleMakeCommand::class, static function ($app) {
return new Console\ConsoleMakeCommand($app['files']);
});
$this->app->singleton(ConsoleMakeCommand::class, static fn ($app) => new Console\ConsoleMakeCommand($app['files']));
}

/**
Expand All @@ -175,9 +167,7 @@ protected function registerConsoleMakeCommand()
*/
protected function registerControllerMakeCommand()
{
$this->app->singleton(ControllerMakeCommand::class, static function ($app) {
return new Console\ControllerMakeCommand($app['files']);
});
$this->app->singleton(ControllerMakeCommand::class, static fn ($app) => new Console\ControllerMakeCommand($app['files']));
}

/**
Expand All @@ -187,9 +177,7 @@ protected function registerControllerMakeCommand()
*/
protected function registerEventMakeCommand()
{
$this->app->singleton(EventMakeCommand::class, static function ($app) {
return new Console\EventMakeCommand($app['files']);
});
$this->app->singleton(EventMakeCommand::class, static fn ($app) => new Console\EventMakeCommand($app['files']));
}

/**
Expand All @@ -199,9 +187,7 @@ protected function registerEventMakeCommand()
*/
protected function registerExceptionMakeCommand()
{
$this->app->singleton(ExceptionMakeCommand::class, static function ($app) {
return new Console\ExceptionMakeCommand($app['files']);
});
$this->app->singleton(ExceptionMakeCommand::class, static fn ($app) => new Console\ExceptionMakeCommand($app['files']));
}

/**
Expand All @@ -211,9 +197,7 @@ protected function registerExceptionMakeCommand()
*/
protected function registerFactoryMakeCommand()
{
$this->app->singleton(FactoryMakeCommand::class, static function ($app) {
return new Console\FactoryMakeCommand($app['files']);
});
$this->app->singleton(FactoryMakeCommand::class, static fn ($app) => new Console\FactoryMakeCommand($app['files']));
}

/**
Expand All @@ -223,9 +207,7 @@ protected function registerFactoryMakeCommand()
*/
protected function registerJobMakeCommand()
{
$this->app->singleton(JobMakeCommand::class, static function ($app) {
return new Console\JobMakeCommand($app['files']);
});
$this->app->singleton(JobMakeCommand::class, static fn ($app) => new Console\JobMakeCommand($app['files']));
}

/**
Expand All @@ -235,9 +217,7 @@ protected function registerJobMakeCommand()
*/
protected function registerListenerMakeCommand()
{
$this->app->singleton(ListenerMakeCommand::class, static function ($app) {
return new Console\ListenerMakeCommand($app['files']);
});
$this->app->singleton(ListenerMakeCommand::class, static fn ($app) => new Console\ListenerMakeCommand($app['files']));
}

/**
Expand All @@ -247,9 +227,7 @@ protected function registerListenerMakeCommand()
*/
protected function registerMailMakeCommand()
{
$this->app->singleton(MailMakeCommand::class, static function ($app) {
return new Console\MailMakeCommand($app['files']);
});
$this->app->singleton(MailMakeCommand::class, static fn ($app) => new Console\MailMakeCommand($app['files']));
}

/**
Expand All @@ -259,9 +237,7 @@ protected function registerMailMakeCommand()
*/
protected function registerMiddlewareMakeCommand()
{
$this->app->singleton(MiddlewareMakeCommand::class, static function ($app) {
return new Console\MiddlewareMakeCommand($app['files']);
});
$this->app->singleton(MiddlewareMakeCommand::class, static fn ($app) => new Console\MiddlewareMakeCommand($app['files']));
}

/**
Expand Down Expand Up @@ -290,9 +266,7 @@ protected function registerMigrateMakeCommand()
*/
protected function registerModelMakeCommand()
{
$this->app->singleton(ModelMakeCommand::class, static function ($app) {
return new Console\ModelMakeCommand($app['files']);
});
$this->app->singleton(ModelMakeCommand::class, static fn ($app) => new Console\ModelMakeCommand($app['files']));
}

/**
Expand All @@ -302,9 +276,7 @@ protected function registerModelMakeCommand()
*/
protected function registerNotificationMakeCommand()
{
$this->app->singleton(NotificationMakeCommand::class, static function ($app) {
return new Console\NotificationMakeCommand($app['files']);
});
$this->app->singleton(NotificationMakeCommand::class, static fn ($app) => new Console\NotificationMakeCommand($app['files']));
}

/**
Expand All @@ -314,9 +286,7 @@ protected function registerNotificationMakeCommand()
*/
protected function registerObserverMakeCommand()
{
$this->app->singleton(ObserverMakeCommand::class, static function ($app) {
return new Console\ObserverMakeCommand($app['files']);
});
$this->app->singleton(ObserverMakeCommand::class, static fn ($app) => new Console\ObserverMakeCommand($app['files']));
}

/**
Expand All @@ -326,9 +296,7 @@ protected function registerObserverMakeCommand()
*/
protected function registerPolicyMakeCommand()
{
$this->app->singleton(PolicyMakeCommand::class, static function ($app) {
return new Console\PolicyMakeCommand($app['files']);
});
$this->app->singleton(PolicyMakeCommand::class, static fn ($app) => new Console\PolicyMakeCommand($app['files']));
}

/**
Expand All @@ -338,9 +306,7 @@ protected function registerPolicyMakeCommand()
*/
protected function registerProviderMakeCommand()
{
$this->app->singleton(ProviderMakeCommand::class, static function ($app) {
return new Console\ProviderMakeCommand($app['files']);
});
$this->app->singleton(ProviderMakeCommand::class, static fn ($app) => new Console\ProviderMakeCommand($app['files']));
}

/**
Expand All @@ -350,9 +316,7 @@ protected function registerProviderMakeCommand()
*/
protected function registerRequestMakeCommand()
{
$this->app->singleton(RequestMakeCommand::class, static function ($app) {
return new Console\RequestMakeCommand($app['files']);
});
$this->app->singleton(RequestMakeCommand::class, static fn ($app) => new Console\RequestMakeCommand($app['files']));
}

/**
Expand All @@ -362,9 +326,7 @@ protected function registerRequestMakeCommand()
*/
protected function registerResourceMakeCommand()
{
$this->app->singleton(ResourceMakeCommand::class, static function ($app) {
return new Console\ResourceMakeCommand($app['files']);
});
$this->app->singleton(ResourceMakeCommand::class, static fn ($app) => new Console\ResourceMakeCommand($app['files']));
}

/**
Expand All @@ -374,9 +336,7 @@ protected function registerResourceMakeCommand()
*/
protected function registerRuleMakeCommand()
{
$this->app->singleton(RuleMakeCommand::class, static function ($app) {
return new Console\RuleMakeCommand($app['files']);
});
$this->app->singleton(RuleMakeCommand::class, static fn ($app) => new Console\RuleMakeCommand($app['files']));
}

/**
Expand All @@ -386,9 +346,7 @@ protected function registerRuleMakeCommand()
*/
protected function registerScopeMakeCommand()
{
$this->app->singleton(ScopeMakeCommand::class, static function ($app) {
return new Console\ScopeMakeCommand($app['files']);
});
$this->app->singleton(ScopeMakeCommand::class, static fn ($app) => new Console\ScopeMakeCommand($app['files']));
}

/**
Expand All @@ -398,9 +356,7 @@ protected function registerScopeMakeCommand()
*/
protected function registerSeederMakeCommand()
{
$this->app->singleton(SeederMakeCommand::class, static function ($app) {
return new Console\SeederMakeCommand($app['files']);
});
$this->app->singleton(SeederMakeCommand::class, static fn ($app) => new Console\SeederMakeCommand($app['files']));
}

/**
Expand All @@ -410,9 +366,7 @@ protected function registerSeederMakeCommand()
*/
protected function registerTestMakeCommand()
{
$this->app->singleton(TestMakeCommand::class, static function ($app) {
return new Console\TestMakeCommand($app['files']);
});
$this->app->singleton(TestMakeCommand::class, static fn ($app) => new Console\TestMakeCommand($app['files']));
}

/**
Expand All @@ -422,9 +376,7 @@ protected function registerTestMakeCommand()
*/
protected function registerViewMakeCommand()
{
$this->app->singleton(ViewMakeCommand::class, static function ($app) {
return new Console\ViewMakeCommand($app['files']);
});
$this->app->singleton(ViewMakeCommand::class, static fn ($app) => new Console\ViewMakeCommand($app['files']));
}

/**
Expand All @@ -434,9 +386,7 @@ protected function registerViewMakeCommand()
*/
protected function registerCacheTableCommand()
{
$this->app->singleton(CacheTableCommand::class, static function ($app) {
return new Console\CacheTableCommand($app['files'], $app['composer']);
});
$this->app->singleton(CacheTableCommand::class, static fn ($app) => new Console\CacheTableCommand($app['files'], $app['composer']));
}

/**
Expand All @@ -446,9 +396,7 @@ protected function registerCacheTableCommand()
*/
protected function registerNotificationTableCommand()
{
$this->app->singleton(NotificationTableCommand::class, static function ($app) {
return new Console\NotificationTableCommand($app['files'], $app['composer']);
});
$this->app->singleton(NotificationTableCommand::class, static fn ($app) => new Console\NotificationTableCommand($app['files'], $app['composer']));
}

/**
Expand All @@ -458,9 +406,7 @@ protected function registerNotificationTableCommand()
*/
protected function registerQueueBatchesTableCommand()
{
$this->app->singleton(BatchesTableCommand::class, static function ($app) {
return new Console\BatchesTableCommand($app['files'], $app['composer']);
});
$this->app->singleton(BatchesTableCommand::class, static fn ($app) => new Console\BatchesTableCommand($app['files'], $app['composer']));
}

/**
Expand All @@ -470,9 +416,7 @@ protected function registerQueueBatchesTableCommand()
*/
protected function registerQueueFailedTableCommand()
{
$this->app->singleton(FailedTableCommand::class, static function ($app) {
return new Console\FailedTableCommand($app['files'], $app['composer']);
});
$this->app->singleton(FailedTableCommand::class, static fn ($app) => new Console\FailedTableCommand($app['files'], $app['composer']));
}

/**
Expand All @@ -482,9 +426,7 @@ protected function registerQueueFailedTableCommand()
*/
protected function registerQueueTableCommand()
{
$this->app->singleton(QueueTableCommand::class, static function ($app) {
return new Console\QueueTableCommand($app['files'], $app['composer']);
});
$this->app->singleton(QueueTableCommand::class, static fn ($app) => new Console\QueueTableCommand($app['files'], $app['composer']));
}

/**
Expand All @@ -494,9 +436,7 @@ protected function registerQueueTableCommand()
*/
protected function registerSessionTableCommand()
{
$this->app->singleton(SessionTableCommand::class, static function ($app) {
return new Console\SessionTableCommand($app['files'], $app['composer']);
});
$this->app->singleton(SessionTableCommand::class, static fn ($app) => new Console\SessionTableCommand($app['files'], $app['composer']));
}

/**
Expand All @@ -506,9 +446,7 @@ protected function registerSessionTableCommand()
*/
protected function registerUserFactoryMakeCommand()
{
$this->app->singleton(Console\UserFactoryMakeCommand::class, static function ($app) {
return new Console\UserFactoryMakeCommand($app['files']);
});
$this->app->singleton(Console\UserFactoryMakeCommand::class, static fn ($app) => new Console\UserFactoryMakeCommand($app['files']));
}

/**
Expand All @@ -518,9 +456,7 @@ protected function registerUserFactoryMakeCommand()
*/
protected function registerUserModelMakeCommand()
{
$this->app->singleton(Console\UserModelMakeCommand::class, static function ($app) {
return new Console\UserModelMakeCommand($app['files']);
});
$this->app->singleton(Console\UserModelMakeCommand::class, static fn ($app) => new Console\UserModelMakeCommand($app['files']));
}

/**
Expand Down

0 comments on commit b058d25

Please sign in to comment.