Skip to content

Commit

Permalink
now service provider to use real IikoTransport instead facade and it …
Browse files Browse the repository at this point in the history
…became deffered
  • Loading branch information
KoTRpa committed Oct 15, 2023
1 parent f121189 commit 22795d5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kma/iiko-transport",
"type": "library",
"version": "0.6.1",
"version": "0.6.2",
"description": "Iiko Transport API",
"keywords": [
"Iiko", "Iiko Transport"
Expand Down
22 changes: 11 additions & 11 deletions src/IikoTransportServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace KMA\IikoTransport;

use Illuminate\Contracts\Support\DeferrableProvider;
use Illuminate\Support\ServiceProvider;

class IikoTransportServiceProvider extends ServiceProvider
class IikoTransportServiceProvider extends ServiceProvider implements DeferrableProvider
{
/** Boot the service provider. */
public function boot()
public function boot(): void
{
if ($this->app->runningInConsole()) {
$this->publishes([
Expand All @@ -16,18 +16,18 @@ public function boot()
}
}

/**
* Register the application services.
*/
public function register()
public function register(): void
{
// Automatically apply the package configuration
$this->mergeConfigFrom(__DIR__.'/../config/iiko_transport.php', 'iiko_transport');

// Register the main class to use with the facade
$this->app->bind('IikoTransport', function ($app) {
$config = app('config')->get('iiko_transport');
$this->app->bindIf(IikoTransport::class, function () {
$config = config('iiko_transport');
return new IikoTransport($config);
});
}

public function provides(): array
{
return [IikoTransport::class];
}
}

0 comments on commit 22795d5

Please sign in to comment.