Completed
Push — master ( 9b4abe...9bc4e2 )
by Ricardo
04:52
created
src/Http/Controllers/AnalyticsController.php 1 patch
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,10 +2,10 @@
 block discarded – undo
2 2
 
3 3
 namespace Tracking\Http\Controllers;
4 4
 
5
-use Tracking\Services\AnalyticsService;
6 5
 use Illuminate\Support\Facades\Schema;
7 6
 use Spatie\Analytics\Analytics;
8 7
 use Spatie\Analytics\Period;
8
+use Tracking\Services\AnalyticsService;
9 9
 
10 10
 class AnalyticsController extends Controller
11 11
 {
Please login to merge, or discard this patch.
src/Http/Controllers/Metrics/MetricsController.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace Tracking\Http\Controllers\Metrics;
4 4
 
5
-use Illuminate\Http\Request;
6 5
 use Tracking\Http\Controllers\Controller as Controller;
7 6
 use Tracking\Models\Metrics\LarametricsLog;
8 7
 use Tracking\Models\Metrics\LarametricsModel;
Please login to merge, or discard this patch.
src/Http/Controllers/Metrics/ModelController.php 1 patch
Unused Use Statements   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,12 +2,10 @@
 block discarded – undo
2 2
 
3 3
 namespace Tracking\Http\Controllers\Metrics;
4 4
 
5
-use Illuminate\Http\Request;
5
+use Carbon\Carbon;
6
+use DB;
6 7
 use Illuminate\Routing\Controller;
7
-use Tracking\Providers\Metrics\LogParser;
8 8
 use Tracking\Models\Metrics\LarametricsModel;
9
-use DB;
10
-use Carbon\Carbon;
11 9
 
12 10
 class ModelController extends Controller
13 11
 {
Please login to merge, or discard this patch.
src/Jobs/CrunchStatistics.php 1 patch
Unused Use Statements   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,15 +5,15 @@
 block discarded – undo
5 5
 namespace Tracking\Jobs;
6 6
 
7 7
 use Exception;
8
-use UAParser\Parser;
9
-use Jenssegers\Agent\Agent;
10 8
 use Illuminate\Bus\Queueable;
11
-use Illuminate\Queue\SerializesModels;
12
-use Illuminate\Queue\InteractsWithQueue;
13 9
 use Illuminate\Contracts\Queue\ShouldQueue;
14 10
 use Illuminate\Foundation\Bus\Dispatchable;
15 11
 use Illuminate\Http\Request as LaravelRequest;
12
+use Illuminate\Queue\InteractsWithQueue;
13
+use Illuminate\Queue\SerializesModels;
14
+use Jenssegers\Agent\Agent;
16 15
 use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
16
+use UAParser\Parser;
17 17
 
18 18
 class CrunchStatistics implements ShouldQueue
19 19
 {
Please login to merge, or discard this patch.
src/Models/Model.php 1 patch
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -3,9 +3,6 @@
 block discarded – undo
3 3
 namespace Tracking\Models;
4 4
 
5 5
 use Illuminate\Database\Eloquent\Model as EloquentModel;
6
-use Illuminate\Database\Eloquent\Builder;
7
-use Illuminate\Support\Facades\Hash;
8
-use Auth;
9 6
 
10 7
 class Model extends EloquentModel
11 8
 {
Please login to merge, or discard this patch.
src/Notifications/Metrics/LogWritten.php 1 patch
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,10 +3,10 @@
 block discarded – undo
3 3
 namespace Siravel\Notifications\Metrics;
4 4
 
5 5
 use Illuminate\Bus\Queueable;
6
-use Illuminate\Notifications\Notification;
7 6
 use Illuminate\Contracts\Queue\ShouldQueue;
8 7
 use Illuminate\Notifications\Messages\MailMessage;
9 8
 use Illuminate\Notifications\Messages\SlackMessage;
9
+use Illuminate\Notifications\Notification;
10 10
 use Tracking\Models\Metrics\LarametricsLog;
11 11
 
12 12
 class LogWritten extends Notification implements ShouldQueue
Please login to merge, or discard this patch.
src/Notifications/Metrics/ModelChanged.php 1 patch
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,10 +3,10 @@
 block discarded – undo
3 3
 namespace Siravel\Notifications\Metrics;
4 4
 
5 5
 use Illuminate\Bus\Queueable;
6
-use Illuminate\Notifications\Notification;
7 6
 use Illuminate\Contracts\Queue\ShouldQueue;
8 7
 use Illuminate\Notifications\Messages\MailMessage;
9 8
 use Illuminate\Notifications\Messages\SlackMessage;
9
+use Illuminate\Notifications\Notification;
10 10
 use Tracking\Models\Metrics\LarametricsModel;
11 11
 
12 12
 class ModelChanged extends Notification implements ShouldQueue
Please login to merge, or discard this patch.
src/Notifications/Metrics/RouteRequested.php 1 patch
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,10 +3,10 @@
 block discarded – undo
3 3
 namespace Siravel\Notifications\Metrics;
4 4
 
5 5
 use Illuminate\Bus\Queueable;
6
-use Illuminate\Notifications\Notification;
7 6
 use Illuminate\Contracts\Queue\ShouldQueue;
8 7
 use Illuminate\Notifications\Messages\MailMessage;
9 8
 use Illuminate\Notifications\Messages\SlackMessage;
9
+use Illuminate\Notifications\Notification;
10 10
 use Tracking\Models\Metrics\LarametricsRequest;
11 11
 
12 12
 class RouteRequested extends Notification implements ShouldQueue
Please login to merge, or discard this patch.
src/Services/AnalyticsService.php 1 patch
Doc Comments   +19 added lines patch added patch discarded remove patch
@@ -43,6 +43,9 @@  discard block
 block discarded – undo
43 43
         }
44 44
     }
45 45
 
46
+    /**
47
+     * @param integer $count
48
+     */
46 49
     public function topReferers($count)
47 50
     {
48 51
         $analytics = $this->model->where('created_at', '>', Carbon::now()->subDays($count))->get();
@@ -51,6 +54,9 @@  discard block
 block discarded – undo
51 54
         return $this->convertDataToItems($data, 'referer', ['unknown' => 0]);
52 55
     }
53 56
 
57
+    /**
58
+     * @param integer $count
59
+     */
54 60
     public function topPages($count)
55 61
     {
56 62
         $analytics = $this->model->where('created_at', '>', Carbon::now()->subDays($count))->get();
@@ -59,6 +65,9 @@  discard block
 block discarded – undo
59 65
         return $this->convertDataToItems($data, 'uri');
60 66
     }
61 67
 
68
+    /**
69
+     * @param integer $count
70
+     */
62 71
     public function topBrowsers($count)
63 72
     {
64 73
         $analytics = $this->model->where('created_at', '>', Carbon::now()->subDays($count))->get();
@@ -74,6 +83,9 @@  discard block
 block discarded – undo
74 83
         return $browsers;
75 84
     }
76 85
 
86
+    /**
87
+     * @param string $key
88
+     */
77 89
     public function convertDataToItems($data, $key, $conversions = [])
78 90
     {
79 91
         if (!isset($conversions['unknown'])) {
@@ -103,6 +115,9 @@  discard block
 block discarded – undo
103 115
         return $conversions;
104 116
     }
105 117
 
118
+    /**
119
+     * @param integer $count
120
+     */
106 121
     public function getDays($count)
107 122
     {
108 123
         $analytics = $this->model->where('created_at', '>', Carbon::now()->subDays($count));
@@ -132,6 +147,10 @@  discard block
 block discarded – undo
132 147
         ];
133 148
     }
134 149
 
150
+    /**
151
+     * @param Carbon $startDate
152
+     * @param Carbon $endDate
153
+     */
135 154
     protected function getDateRange($startDate, $endDate)
136 155
     {
137 156
         $dates = [];
Please login to merge, or discard this patch.