Passed
Branch master (a8d87c)
by John
02:45
created
app/Services/ApiService.php 1 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 1 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 1 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/AppServiceProvider.php 1 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/Policies/TasksPolicy.php 1 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.
app/Http/Controllers/TasksController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 class TasksController extends Controller
10 10
 {
11 11
     protected $task;
12
-    function __construct( TasksRepository $task)
12
+    function __construct(TasksRepository $task)
13 13
     {
14 14
         $this->task = $task;
15 15
         $this->middleware('auth')->except('index');
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
                 return view('home');
26 26
             } else {
27 27
                 $archives = $this->task->allTask();
28
-               return view('tasks', compact( 'archives'));
28
+               return view('tasks', compact('archives'));
29 29
             }
30 30
     }
31 31
     /**
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public function store(TaskRequest $task)
48 48
     {
49
-        Tasks::create(\request(['task', 'complete','user_id']));
49
+        Tasks::create(\request([ 'task', 'complete', 'user_id' ]));
50 50
         return redirect()->home();
51 51
     }
52 52
 
Please login to merge, or discard this patch.
app/Http/Controllers/RegisterController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
      */
33 33
     public function store(Request $request, RegisterForm $form)
34 34
     {
35
-       $user = \TaskManager\User::create($request->only('email','name','password'));
35
+       $user = \TaskManager\User::create($request->only('email', 'name', 'password'));
36 36
        auth()->login($user);
37 37
        \Mail::to($user)->send(new WelcomeNewUser($user));
38 38
        return redirect()->home();
Please login to merge, or discard this patch.