remove Application type hinting

This commit is contained in:
Holger Reinhardt 2016-07-29 14:05:07 +02:00
parent c2e8486494
commit 02f2712fab

View File

@ -2,7 +2,6 @@
namespace Hlgrrnhrdt\Resque; namespace Hlgrrnhrdt\Resque;
use Hlgrrnhrdt\Resque\Console\WorkCommand; use Hlgrrnhrdt\Resque\Console\WorkCommand;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
use Resque; use Resque;
@ -24,24 +23,22 @@ class ResqueServiceProvider extends ServiceProvider
$this->registerWorkCommand(); $this->registerWorkCommand();
} }
protected function registerManager() protected function registerManager()
{ {
$this->app->singleton('resque.manager', function (Application $app) { $this->app->singleton('resque.manager', function () {
$config = $app['config']['resque.connection']; $config = $this->app['config']['resque.connection'];
$resque = new Resque(); $resque = new Resque();
$resque->setBackend(implode(':', [$config['host'], $config['port']]), $config['db']); $resque->setBackend(implode(':', [$config['host'], $config['port']]), $config['db']);
return new ResqueManager($resque, $app['config']['resque.trackStatus']); return new ResqueManager($resque, $this->app['config']['resque.trackStatus']);
}); });
} }
protected function registerWorkCommand() protected function registerWorkCommand()
{ {
$this->app->singleton('command.resque.work', function (Application $app) { $this->app->singleton('command.resque.work', function () {
return new WorkCommand($app->make('resque.manager')); return new WorkCommand($this->app->make('resque.manager'));
}); });
$this->commands('command.resque.work'); $this->commands('command.resque.work');
} }