@@ -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 | { |
@@ -45,13 +45,13 @@ discard block |
||
45 | 45 | public function register() |
46 | 46 | { |
47 | 47 | /** |
48 | - * publish migrations |
|
49 | - */ |
|
48 | + * publish migrations |
|
49 | + */ |
|
50 | 50 | $this->publishes([__DIR__ . '/../database/migrations' => database_path('migrations')], 'migrations'); |
51 | 51 | |
52 | 52 | /** |
53 | - * Register Facade |
|
54 | - */ |
|
53 | + * Register Facade |
|
54 | + */ |
|
55 | 55 | $this->app->bind('Qwatch', function () { |
56 | 56 | return (new Qwatcher); |
57 | 57 | }); |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | include __DIR__.'/routes.php'; |
63 | 63 | |
64 | 64 | /** |
65 | - * Register artisan Commands |
|
66 | - */ |
|
65 | + * Register artisan Commands |
|
66 | + */ |
|
67 | 67 | // $this->commands([ |
68 | 68 | // \Maqe\Qwatcher\Commands\SomeCommand1::class, |
69 | 69 | // \Maqe\Qwatcher\Commands\SomeCommand2::class |
@@ -18,15 +18,15 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function boot() |
20 | 20 | { |
21 | - Queue::before(function ($job) { |
|
21 | + Queue::before(function($job) { |
|
22 | 22 | Qwatch::tracks(new ProcessTracks($job->job->getJobId(), $job->job)); |
23 | 23 | }); |
24 | 24 | |
25 | - Queue::after(function ($job) { |
|
25 | + Queue::after(function($job) { |
|
26 | 26 | Qwatch::tracks(new SucceedTracks($job->job->getJobId(), $job->job)); |
27 | 27 | }); |
28 | 28 | |
29 | - Queue::failing(function (JobFailed $job) { |
|
29 | + Queue::failing(function(JobFailed $job) { |
|
30 | 30 | // dd($event); |
31 | 31 | Qwatch::tracks(new FailedTracks($job->job->getJobId(), $job->job)); |
32 | 32 | }); |
@@ -47,12 +47,12 @@ discard block |
||
47 | 47 | /** |
48 | 48 | * publish migrations |
49 | 49 | */ |
50 | - $this->publishes([__DIR__ . '/../database/migrations' => database_path('migrations')], 'migrations'); |
|
50 | + $this->publishes([__DIR__.'/../database/migrations' => database_path('migrations')], 'migrations'); |
|
51 | 51 | |
52 | 52 | /** |
53 | 53 | * Register Facade |
54 | 54 | */ |
55 | - $this->app->bind('Qwatch', function () { |
|
55 | + $this->app->bind('Qwatch', function() { |
|
56 | 56 | return (new Qwatcher); |
57 | 57 | }); |
58 | 58 |
@@ -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 |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * Insert or update Track table depend on TracksInterface sub class (Adapter) |
35 | 35 | * |
36 | 36 | * @param TracksInterface $tracks Sub class that implements TracksInterface |
37 | - * @return mixed |
|
37 | + * @return TracksInterface |
|
38 | 38 | */ |
39 | 39 | public static function tracks(TracksInterface $tracks) |
40 | 40 | { |
@@ -44,7 +44,6 @@ discard block |
||
44 | 44 | /** |
45 | 45 | * Added sort order to $this->sortOrder string, use with builder |
46 | 46 | * |
47 | - * @param string $sortBy The sort string |
|
48 | 47 | * @return $this |
49 | 48 | */ |
50 | 49 | public function sortBy($sortColumn = 'id', $sortOrder = 'asc') |
@@ -228,7 +227,7 @@ discard block |
||
228 | 227 | * Filter sort order column string |
229 | 228 | * |
230 | 229 | * @param string $sortColumn The sort order column string |
231 | - * @return stirng |
|
230 | + * @return string |
|
232 | 231 | */ |
233 | 232 | protected function filterSortColumn($sortColumn) |
234 | 233 | { |
@@ -239,7 +238,7 @@ discard block |
||
239 | 238 | * Filter sort order string, allowed only asc, desc |
240 | 239 | * |
241 | 240 | * @param string $sortOrder The sort order string |
242 | - * @return stirng |
|
241 | + * @return string |
|
243 | 242 | */ |
244 | 243 | protected function filterSortOrder($sortOrder) |
245 | 244 | { |
@@ -1,8 +1,6 @@ |
||
1 | 1 | <?php namespace Maqe\Qwatcher; |
2 | 2 | |
3 | 3 | use Illuminate\Database\Eloquent\Builder; |
4 | -use Illuminate\Database\Eloquent\Collection; |
|
5 | -use Illuminate\Pagination\LengthAwarePaginator; |
|
6 | 4 | use Maqe\Qwatcher\Tracks\Enums\StatusType; |
7 | 5 | use Maqe\Qwatcher\Tracks\TracksInterface; |
8 | 6 | use Maqe\Qwatcher\Tracks\Tracks; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function getByStatus($status, $per_page = null) |
124 | 124 | { |
125 | - if(!in_array($status, $this->statusable)) { |
|
125 | + if (!in_array($status, $this->statusable)) { |
|
126 | 126 | throw new \InvalidArgumentException('"'.$status.'" is not allowed in status type'); |
127 | 127 | } |
128 | 128 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function getByJobName($name, $per_page = null) |
154 | 154 | { |
155 | - $collecName = strtolower(str_replace('_', '%',$name)); |
|
155 | + $collecName = strtolower(str_replace('_', '%', $name)); |
|
156 | 156 | $condition = "`tracks`.`job_name` LIKE '%{$collecName}%'"; |
157 | 157 | $builder = Tracks::whereRaw($condition); |
158 | 158 |
@@ -4,6 +4,9 @@ |
||
4 | 4 | |
5 | 5 | class FailedTracks extends TracksAbstract implements TracksInterface |
6 | 6 | { |
7 | + /** |
|
8 | + * @param \Illuminate\Contracts\Queue\Job $job |
|
9 | + */ |
|
7 | 10 | public function __construct($id, $job = null, array $meta = []) |
8 | 11 | { |
9 | 12 | return $this->pushToTracks($id, $job); |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | /** |
12 | 12 | * Transform records in tracks collection |
13 | 13 | * |
14 | - * @param Tracks $tracks The tracks collection |
|
15 | - * @return Collection The tracks collection after transform |
|
14 | + * @param Tracks $track The tracks collection |
|
15 | + * @return Tracks The tracks collection after transform |
|
16 | 16 | */ |
17 | 17 | public function transform(Tracks $track) |
18 | 18 | { |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | /** |
56 | 56 | * Get current Status as text, tracking by sequential of status datetime |
57 | 57 | * |
58 | - * @param $track The track object |
|
58 | + * @param Tracks $track The track object |
|
59 | 59 | * @return string |
60 | 60 | */ |
61 | 61 | public function getTrackStatus($track) |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | /** |
75 | 75 | * Get current Status prias text, tracking by sequential of status datetime |
76 | 76 | * |
77 | - * @param $track The track object |
|
77 | + * @param Tracks $track The track object |
|
78 | 78 | * @return string |
79 | 79 | */ |
80 | 80 | public function getTrackStatusTime($track) |
@@ -31,7 +31,7 @@ |
||
31 | 31 | */ |
32 | 32 | public function transforms(Collection $tracks) |
33 | 33 | { |
34 | - return $tracks->each(function ($track) { |
|
34 | + return $tracks->each(function($track) { |
|
35 | 35 | $track = $this->transform($track); |
36 | 36 | }); |
37 | 37 | } |
@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | use App\Http\Controllers\Controller; |
4 | 4 | use Illuminate\Http\Request; |
5 | -use Maqe\Qwatcher\Tracks\Tracks; |
|
6 | 5 | use Qwatcher; |
7 | 6 | |
8 | 7 | class TracksController extends Controller |
@@ -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'); |