@@ -63,7 +63,7 @@ |
||
| 63 | 63 | /** |
| 64 | 64 | * Get the services provided by the provider. |
| 65 | 65 | * |
| 66 | - * @return array |
|
| 66 | + * @return string[] |
|
| 67 | 67 | */ |
| 68 | 68 | public function provides() |
| 69 | 69 | { |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | use Queue; |
| 4 | 4 | use Illuminate\Support\ServiceProvider; |
| 5 | -use Illuminate\Support\Facades\Log; |
|
| 6 | 5 | |
| 7 | 6 | class QwatcherServiceProvider extends ServiceProvider |
| 8 | 7 | { |
@@ -34,26 +34,26 @@ |
||
| 34 | 34 | public function register() |
| 35 | 35 | { |
| 36 | 36 | /** |
| 37 | - * publish migrations |
|
| 38 | - */ |
|
| 37 | + * publish migrations |
|
| 38 | + */ |
|
| 39 | 39 | $this->publishes([__DIR__ . '/../database/migrations' => database_path('migrations')], 'migrations'); |
| 40 | 40 | $this->publishes([__DIR__ . '/../config/qwatcher.php' => config_path('qwatcher.php')], 'config'); |
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | - * merge config |
|
| 44 | - */ |
|
| 43 | + * merge config |
|
| 44 | + */ |
|
| 45 | 45 | $this->mergeConfigFrom(__DIR__ . '/../config/qwatcher.php', 'qwatcher'); |
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | - * Register Facade |
|
| 49 | - */ |
|
| 48 | + * Register Facade |
|
| 49 | + */ |
|
| 50 | 50 | $this->app->bind('Qwatch', function () { |
| 51 | 51 | return (new Qwatcher); |
| 52 | 52 | }); |
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | - * Register artisan Commands |
|
| 56 | - */ |
|
| 55 | + * Register artisan Commands |
|
| 56 | + */ |
|
| 57 | 57 | // $this->commands([ |
| 58 | 58 | // \Maqe\Qwatcher\Commands\SomeCommand1::class, |
| 59 | 59 | // \Maqe\Qwatcher\Commands\SomeCommand2::class |
@@ -17,15 +17,15 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | public function boot() |
| 19 | 19 | { |
| 20 | - Queue::before(function ($job) { |
|
| 20 | + Queue::before(function($job) { |
|
| 21 | 21 | Qwatch::tracks(new ProcessTracks($job->job->getJobId(), $job->job)); |
| 22 | 22 | }); |
| 23 | 23 | |
| 24 | - Queue::after(function ($job) { |
|
| 24 | + Queue::after(function($job) { |
|
| 25 | 25 | Qwatch::tracks(new SucceedTracks($job->job->getJobId(), $job->job)); |
| 26 | 26 | }); |
| 27 | 27 | |
| 28 | - Queue::failing(function ($job) { |
|
| 28 | + Queue::failing(function($job) { |
|
| 29 | 29 | Qwatch::tracks(new FailedTracks($job->job->getJobId(), $job->job)); |
| 30 | 30 | }); |
| 31 | 31 | } |
@@ -40,18 +40,18 @@ discard block |
||
| 40 | 40 | /** |
| 41 | 41 | * publish migrations |
| 42 | 42 | */ |
| 43 | - $this->publishes([__DIR__ . '/../database/migrations' => database_path('migrations')], 'migrations'); |
|
| 44 | - $this->publishes([__DIR__ . '/../config/qwatcher.php' => config_path('qwatcher.php')], 'config'); |
|
| 43 | + $this->publishes([__DIR__.'/../database/migrations' => database_path('migrations')], 'migrations'); |
|
| 44 | + $this->publishes([__DIR__.'/../config/qwatcher.php' => config_path('qwatcher.php')], 'config'); |
|
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * merge config |
| 48 | 48 | */ |
| 49 | - $this->mergeConfigFrom(__DIR__ . '/../config/qwatcher.php', 'qwatcher'); |
|
| 49 | + $this->mergeConfigFrom(__DIR__.'/../config/qwatcher.php', 'qwatcher'); |
|
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * Register Facade |
| 53 | 53 | */ |
| 54 | - $this->app->bind('Qwatch', function () { |
|
| 54 | + $this->app->bind('Qwatch', function() { |
|
| 55 | 55 | return (new Qwatcher); |
| 56 | 56 | }); |
| 57 | 57 | |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | use Illuminate\Queue\Queue; |
| 4 | 4 | use Carbon\Carbon; |
| 5 | -use Maqe\Qwatcher\Tracks\Enums\StatusType; |
|
| 6 | 5 | |
| 7 | 6 | abstract class TracksAbstract extends Queue |
| 8 | 7 | { |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Maqe\Qwatcher\Traits; |
| 4 | 4 | |
| 5 | -use DB; |
|
| 6 | 5 | use Illuminate\Contracts\Bus\Dispatcher; |
| 7 | 6 | |
| 8 | 7 | trait WatchableDispatchesJobs |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('tracks', function (Blueprint $table) { |
|
| 16 | + Schema::create('tracks', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->string('driver'); |
| 19 | 19 | $table->integer('queue_id'); |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | * Insert or update Track table depand on TracksInterface sub class |
| 15 | 15 | * |
| 16 | 16 | * @param TracksInterface $tracks Sub class that implements TracksInterface |
| 17 | - * @return mixed |
|
| 17 | + * @return TracksInterface |
|
| 18 | 18 | */ |
| 19 | 19 | public function tracks(TracksInterface $tracks) |
| 20 | 20 | { |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | /** |
| 80 | 80 | * Transform records in tracks collection |
| 81 | 81 | * |
| 82 | - * @param Collection $tracks The tracks collection |
|
| 82 | + * @param Collection $track The tracks collection |
|
| 83 | 83 | * @return Collection The tracks collection after transform |
| 84 | 84 | */ |
| 85 | 85 | protected function transform($track) |
@@ -1,10 +1,8 @@ |
||
| 1 | 1 | <?php namespace Maqe\Qwatcher; |
| 2 | 2 | |
| 3 | 3 | use Illuminate\Database\Eloquent\Builder; |
| 4 | -use Illuminate\Database\Eloquent\ModelNotFoundException; |
|
| 5 | 4 | use Maqe\Qwatcher\Tracks\TracksInterface; |
| 6 | 5 | use Maqe\Qwatcher\Tracks\Tracks; |
| 7 | -use Carbon\Carbon; |
|
| 8 | 6 | |
| 9 | 7 | class Qwatcher |
| 10 | 8 | { |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | */ |
| 71 | 71 | public function getByJobName($name) |
| 72 | 72 | { |
| 73 | - $collecName = str_replace('\\', '%',$name); |
|
| 73 | + $collecName = str_replace('\\', '%', $name); |
|
| 74 | 74 | $condition = "`tracks`.`meta` LIKE '%\"job_name\":\"{$collecName}\"%'"; |
| 75 | 75 | |
| 76 | 76 | return $this->transforms(Tracks::whereRaw($condition)->get()); |