Passed
Push — master ( a8d87c...15ec2f )
by John
05:10
created
app/Services/ApiService.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
 
35 35
     public function exists()
36 36
     {
37
-      // dd($this->api->where('user_id', auth()->id())->first());
37
+        // dd($this->api->where('user_id', auth()->id())->first());
38 38
         if (count(ApiKeys::where('user_id', auth()->id())->first())) {
39 39
             return true;
40 40
         } else {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     $this->api = $api;
19 19
     }
20 20
 
21
-    public function generateKey($user_id=null)
21
+    public function generateKey($user_id = null)
22 22
     {
23 23
         $this->api->key = uniqid();
24 24
         $this->api->active = true;
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
         return $this->api->key;
28 28
     }
29 29
 
30
-    public function getApi(){
30
+    public function getApi() {
31 31
         return ApiKeys::where('user_id', auth()->id())->first();
32 32
     }
33 33
 
Please login to merge, or discard this patch.
app/Services/CaptchaService.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     public static function GenerateCode($start = "1000", $end="99999"){
12 12
         $code = random_int($start, $end);
13 13
         session()->put('code', $code);
14
-       // dd(session()->get('code'));
14
+        // dd(session()->get('code'));
15 15
         return $code;
16 16
 }
17 17
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,16 +6,16 @@
 block discarded – undo
6 6
  * Time: 01:02
7 7
  */
8 8
 namespace TaskManager\Services;
9
-class CaptchaService{
9
+class CaptchaService {
10 10
 
11
-    public static function GenerateCode($start = "1000", $end="99999"){
11
+    public static function GenerateCode($start = "1000", $end = "99999") {
12 12
         $code = random_int($start, $end);
13 13
         session()->put('code', $code);
14 14
        // dd(session()->get('code'));
15 15
         return $code;
16 16
 }
17 17
 
18
-    public function flushCode(){
18
+    public function flushCode() {
19 19
         session()->forget('code');
20 20
     }
21 21
 
Please login to merge, or discard this patch.
app/ApiKeys.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@
 block discarded – undo
8 8
 class ApiKeys extends Model
9 9
 {
10 10
     protected $user;
11
-    public function user(){
11
+    public function user() {
12 12
         return $this->hasOne('\TaskManager\User', 'id');
13 13
     }
14
-    public function tasks(){
14
+    public function tasks() {
15 15
         $this->hasMany('\TaskManager\Tasks', 'user_id');
16 16
     }
17 17
 
Please login to merge, or discard this patch.
app/Exceptions/Handler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
     protected function unauthenticated($request, AuthenticationException $exception)
58 58
     {
59 59
         if ($request->expectsJson()) {
60
-            return response()->json(['error' => 'Unauthenticated.'], 401);
60
+            return response()->json([ 'error' => 'Unauthenticated.' ], 401);
61 61
         }
62 62
 
63 63
         return redirect()->guest(route('login'));
Please login to merge, or discard this patch.
app/Tasks.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 
11 11
     public function user()
12 12
     {
13
-       return $this->belongsTo('\TaskManager\User', 'user_id');
13
+        return $this->belongsTo('\TaskManager\User', 'user_id');
14 14
     }
15 15
     public function setCompleteAttribute($value){
16 16
         $this->attributes['complete'] = $value ?? false;
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,16 +6,16 @@
 block discarded – undo
6 6
 
7 7
 class Tasks extends Model
8 8
 {
9
-    protected $fillable = [ 'task', 'complete','user_id'];
9
+    protected $fillable = [ 'task', 'complete', 'user_id' ];
10 10
 
11 11
     public function user()
12 12
     {
13 13
        return $this->belongsTo('\TaskManager\User', 'user_id');
14 14
     }
15
-    public function setCompleteAttribute($value){
16
-        $this->attributes['complete'] = $value ?? false;
15
+    public function setCompleteAttribute($value) {
16
+        $this->attributes[ 'complete' ] = $value ?? false;
17 17
     }
18
-    public function setUserIdAttribute($value){
19
-        $this->attributes['user_id'] = auth()->id();
18
+    public function setUserIdAttribute($value) {
19
+        $this->attributes[ 'user_id' ] = auth()->id();
20 20
     }
21 21
 }
Please login to merge, or discard this patch.
app/Providers/AuthServiceProvider.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
     {
28 28
         $this->registerPolicies();
29 29
         Gate::resource('tasks', '\TaskManager\Policies\TasksPolicy');
30
-       //$gate->define('task-delete','\TaskManager\Policies\TasksPolicy@delete');
30
+        //$gate->define('task-delete','\TaskManager\Policies\TasksPolicy@delete');
31 31
 
32 32
 
33 33
         //
Please login to merge, or discard this patch.
app/Providers/AppServiceProvider.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,10 +18,10 @@
 block discarded – undo
18 18
     {
19 19
 
20 20
         \Validator::extend('match', function ($attribute, $value, $parameters, $validator) {
21
-           if($value == session()->get('code')){
22
-               return true;
23
-           }
24
-           return false;
21
+            if($value == session()->get('code')){
22
+                return true;
23
+            }
24
+            return false;
25 25
         });
26 26
 
27 27
         \Schema::defaultStringLength(300);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@
 block discarded – undo
17 17
     public function boot()
18 18
     {
19 19
 
20
-        \Validator::extend('match', function ($attribute, $value, $parameters, $validator) {
21
-           if($value == session()->get('code')){
20
+        \Validator::extend('match', function($attribute, $value, $parameters, $validator) {
21
+           if ($value == session()->get('code')) {
22 22
                return true;
23 23
            }
24 24
            return false;
Please login to merge, or discard this patch.
app/Providers/RouteServiceProvider.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
     protected function mapWebRoutes()
53 53
     {
54 54
         Route::middleware('web')
55
-             ->namespace($this->namespace)
56
-             ->group(base_path('routes/web.php'));
55
+                ->namespace($this->namespace)
56
+                ->group(base_path('routes/web.php'));
57 57
     }
58 58
 
59 59
     /**
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
     protected function mapApiRoutes()
67 67
     {
68 68
         Route::prefix('api')
69
-             ->middleware('api')
70
-             ->namespace($this->namespace)
71
-             ->group(base_path('routes/api.php'));
69
+                ->middleware('api')
70
+                ->namespace($this->namespace)
71
+                ->group(base_path('routes/api.php'));
72 72
     }
73 73
 }
Please login to merge, or discard this patch.
app/Policies/TasksPolicy.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
      */
22 22
     public function view(User $user, Tasks $tasks)
23 23
     {
24
-       return dd($tasks);
24
+        return dd($tasks);
25 25
 
26 26
     }
27 27
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -50,10 +50,10 @@  discard block
 block discarded – undo
50 50
      */
51 51
     public function update(User $user, Tasks $task)
52 52
     {
53
-        if($user->id == $task->user_id){
53
+        if ($user->id == $task->user_id) {
54 54
             return true;
55 55
         }
56
-        else{
56
+        else {
57 57
             return false;
58 58
         }
59 59
     }
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
     public function delete(User $user, Tasks $id)
70 70
     {
71 71
 
72
-        if($user->id == $id->user_id){
72
+        if ($user->id == $id->user_id) {
73 73
             return true;
74 74
         }
75
-        else{
75
+        else {
76 76
             return false;
77 77
         }
78 78
 
Please login to merge, or discard this patch.
Braces   +7 added lines, -9 removed lines patch added patch discarded remove patch
@@ -33,11 +33,11 @@  discard block
 block discarded – undo
33 33
      */
34 34
     public function create(User $user)
35 35
     {
36
-        if ($user->active)
37
-            return true;
38
-
39
-        else
40
-            return false;
36
+        if ($user->active) {
37
+                    return true;
38
+        } else {
39
+                    return false;
40
+        }
41 41
     }
42 42
 
43 43
 
@@ -52,8 +52,7 @@  discard block
 block discarded – undo
52 52
     {
53 53
         if($user->id == $task->user_id){
54 54
             return true;
55
-        }
56
-        else{
55
+        } else{
57 56
             return false;
58 57
         }
59 58
     }
@@ -71,8 +70,7 @@  discard block
 block discarded – undo
71 70
 
72 71
         if($user->id == $id->user_id){
73 72
             return true;
74
-        }
75
-        else{
73
+        } else{
76 74
             return false;
77 75
         }
78 76
 
Please login to merge, or discard this patch.