Skip to content

Commit

Permalink
Mark MinionsServiceProvider as deferred. Closes #13
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Mar 10, 2020
1 parent c745885 commit 4ccd5af
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/MinionsServiceProvider.php
Expand Up @@ -3,10 +3,11 @@
namespace Minions;

use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Support\DeferrableProvider;
use Illuminate\Support\ServiceProvider;
use React\EventLoop\LoopInterface;

class MinionsServiceProvider extends ServiceProvider
class MinionsServiceProvider extends ServiceProvider implements DeferrableProvider
{
use Concerns\Configuration;

Expand All @@ -33,4 +34,14 @@ public function boot()
__DIR__.'/../config/minions.php' => \config_path('minions.php'),
], 'config');
}

/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return ['minions.client'];
}
}
2 changes: 1 addition & 1 deletion tests/Unit/MinionsServiceProviderTest.php
Expand Up @@ -12,6 +12,6 @@ public function it_declared_as_eagered_service_provider()
{
$provider = new MinionsServiceProvider(null);

$this->assertFalse($provider->isDeferred());
$this->assertTrue($provider->isDeferred());
}
}

0 comments on commit 4ccd5af

Please sign in to comment.