Skip to content

Commit

Permalink
refactor: use native Application Container method
Browse files Browse the repository at this point in the history
  • Loading branch information
SonyPradana committed May 18, 2024
1 parent f446cd8 commit 84f793f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 5 additions & 3 deletions src/System/Integrate/Console/Karnel.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@

class Karnel
{
/**
* Application Container.
*/
protected Application $app;

/** @var int concole exit status */
protected $exit_code;

Expand Down Expand Up @@ -93,9 +97,7 @@ public function handle($arguments)
*/
public function bootstrap(): void
{
if (method_exists($this->app, 'bootstrapWith')) {
$this->app->{'bootstrapWith'}($this->bootstrappers);
}
$this->app->bootstrapWith($this->bootstrappers);
}

/**
Expand Down
9 changes: 5 additions & 4 deletions src/System/Integrate/Http/Karnel.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@

use System\Http\Request;
use System\Http\Response;
use System\Integrate\Application;
use System\Integrate\Bootstrap\BootProviders;
use System\Integrate\Bootstrap\RegisterProviders;
use System\Integrate\Application;
use System\Integrate\Exceptions\Handler;
use System\Integrate\Http\Middleware\MaintenanceMiddleware;
use System\Router\Router;

class Karnel
{
/**
* Application Container.
*/
protected Application $app;

/** @var array<int, class-string> Global middleware */
Expand Down Expand Up @@ -77,9 +80,7 @@ public function handle(Request $request)
*/
public function bootstrap(): void
{
if (method_exists($this->app, 'bootstrapWith')) {
$this->app->{'bootstrapWith'}($this->bootstrappers);
}
$this->app->bootstrapWith($this->bootstrappers);
}

/**
Expand Down

0 comments on commit 84f793f

Please sign in to comment.