Passed
Push — master ( 07420f...521211 )
by Quim González
04:06
created
app/Console/Commands/DestroyTaskCommand.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         try{
46 46
 
47 47
             $id = $this->argument('id') ? $this->argument('id') : $this->ask('Event id?');
48
-           $count = Task::destroy($id);
48
+            $count = Task::destroy($id);
49 49
 
50 50
 
51 51
 //            Task::destroy([
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
             $this->error('error' . $e);
59 59
         }
60 60
         if($count == 0){
61
-           $this->alert("Task does not exist");
61
+            $this->alert("Task does not exist");
62 62
         }else {
63 63
             $this->info('Task has been deleted to database succesfully');
64 64
         }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     public function handle()
43 43
     {
44 44
 
45
-        try{
45
+        try {
46 46
 
47 47
             $id = $this->argument('id') ? $this->argument('id') : $this->ask('Event id?');
48 48
            $count = Task::destroy($id);
@@ -54,10 +54,10 @@  discard block
 block discarded – undo
54 54
 //            ]);
55 55
 
56 56
 
57
-        } catch ( Exception $e) {
57
+        } catch (Exception $e) {
58 58
             $this->error('error' . $e);
59 59
         }
60
-        if($count == 0){
60
+        if ($count == 0) {
61 61
            $this->alert("Task does not exist");
62 62
         }else {
63 63
             $this->info('Task has been deleted to database succesfully');
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
         }
60 60
         if($count == 0){
61 61
            $this->alert("Task does not exist");
62
-        }else {
62
+        } else {
63 63
             $this->info('Task has been deleted to database succesfully');
64 64
         }
65 65
 
Please login to merge, or discard this patch.
app/Console/Commands/CreateTaskCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,12 +46,12 @@
 block discarded – undo
46 46
 
47 47
 
48 48
 
49
-        try{
49
+        try {
50 50
 
51 51
             Task::create([
52 52
                 'name'=>$this->argument('name') ? $this->argument('name') : $this->ask('Event name?')
53 53
             ]);
54
-        } catch ( Exception $e) {
54
+        } catch (Exception $e) {
55 55
             $this->error('error' . $e);
56 56
         }
57 57
 
Please login to merge, or discard this patch.
app/Console/Commands/ListTaskCommand.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,13 +42,13 @@
 block discarded – undo
42 42
         //$headers = ['id','name','created_at','updated_at'];
43 43
 
44 44
 
45
-        try{
45
+        try {
46 46
             $tasks = Task::all()->toArray();
47 47
             $headers = array_keys($tasks[0]);
48 48
 
49
-            $this->table($headers,$tasks);
49
+            $this->table($headers, $tasks);
50 50
 
51
-        }catch (exception $e){
51
+        } catch (exception $e) {
52 52
             $this->error('Error: ' . $e);
53 53
         }
54 54
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
 
49 49
             $this->table($headers,$tasks);
50 50
 
51
-        }catch (exception $e){
51
+        } catch (exception $e){
52 52
             $this->error('Error: ' . $e);
53 53
         }
54 54
 
Please login to merge, or discard this patch.
app/Console/Kernel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
      */
36 36
     protected function commands()
37 37
     {
38
-        $this->load(__DIR__.'/Commands');
38
+        $this->load(__DIR__ . '/Commands');
39 39
 
40 40
         require base_path('routes/console.php');
41 41
     }
Please login to merge, or discard this patch.
app/Http/Controllers/TaskController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 
18 18
         $tasks = Task::all();
19 19
         //return view('tasks',['tasks' => json_encode($tasks)]);
20
-        return view('tasks_php',['tasks' => $tasks]);
20
+        return view('tasks_php', ['tasks' => $tasks]);
21 21
     }
22 22
 
23 23
     /**
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 //        'task'=>$task->name
60 60
 //    ]);
61 61
 
62
-        return view('show_task',['task' => $task]);
62
+        return view('show_task', ['task' => $task]);
63 63
 
64 64
     }
65 65
 
Please login to merge, or discard this patch.
app/Http/Controllers/ApiUserController.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -23,18 +23,18 @@
 block discarded – undo
23 23
     public function store(Request $request)
24 24
     {
25 25
 
26
-       $request->validate([
27
-           'name'     => 'required|max:255',
28
-           'username' => 'sometimes|required|max:255|unique:users',
29
-           'email'    => 'required|email|max:255|unique:users',
30
-           'password' => 'required|min:6'
26
+        $request->validate([
27
+            'name'     => 'required|max:255',
28
+            'username' => 'sometimes|required|max:255|unique:users',
29
+            'email'    => 'required|email|max:255|unique:users',
30
+            'password' => 'required|min:6'
31 31
         ]);
32 32
 
33
-           $user =  User::create([
34
-               'name' => $request->name,
35
-               'username' => $request->username,
36
-               'email' => $request->email,
37
-               'password' => bcrypt($request->password),
33
+            $user =  User::create([
34
+                'name' => $request->name,
35
+                'username' => $request->username,
36
+                'email' => $request->email,
37
+                'password' => bcrypt($request->password),
38 38
             ]);
39 39
 
40 40
         return $user;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     }
14 14
     
15 15
     
16
-    public function show(User $user){
16
+    public function show(User $user) {
17 17
     
18 18
         return $user;
19 19
     }
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
            'password' => 'required|min:6'
31 31
         ]);
32 32
 
33
-           $user =  User::create([
33
+           $user = User::create([
34 34
                'name' => $request->name,
35 35
                'username' => $request->username,
36 36
                'email' => $request->email,
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/LoginController.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
      */
58 58
     public function username()
59 59
     {
60
-        return config('auth.providers.users.field','email');
60
+        return config('auth.providers.users.field', 'email');
61 61
     }
62 62
 
63 63
     /**
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,9 @@
 block discarded – undo
68 68
      */
69 69
     protected function attemptLogin(Request $request)
70 70
     {
71
-        if ($this->username() === 'email') return $this->attemptLoginAtAuthenticatesUsers($request);
71
+        if ($this->username() === 'email') {
72
+            return $this->attemptLoginAtAuthenticatesUsers($request);
73
+        }
72 74
         if ( ! $this->attemptLoginAtAuthenticatesUsers($request)) {
73 75
             return $this->attempLoginUsingUsernameAsAnEmail($request);
74 76
         }
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/ResetPasswordController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         // will update the password on an actual user model and persist it to the
38 38
         // database. Otherwise we will parse the error and return the response.
39 39
         $response = $this->broker()->reset(
40
-            $this->credentials($request), function ($user, $password) {
40
+            $this->credentials($request), function($user, $password) {
41 41
             $this->resetPassword($user, $password);
42 42
         }
43 43
         );
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      * @param  string  $response
58 58
      * @return \Illuminate\Http\RedirectResponse
59 59
      */
60
-    protected function sendResetResponse(Request $request,$response)
60
+    protected function sendResetResponse(Request $request, $response)
61 61
     {
62 62
         if ($request->expectsJson()) {
63 63
             return response()->json([
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     protected function sendResetFailedResponse(Request $request, $response)
79 79
     {
80 80
         if ($request->expectsJson()) {
81
-            return new JsonResponse(['email' => trans($response) ], 422);
81
+            return new JsonResponse(['email' => trans($response)], 422);
82 82
         }
83 83
         return redirect()->back()
84 84
             ->withInput($request->only('email'))
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/RegisterController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
             'email'    => $data['email'],
84 84
             'password' => bcrypt($data['password']),
85 85
         ];
86
-        if (config('auth.providers.users.field','email') === 'username' && isset($data['username'])) {
86
+        if (config('auth.providers.users.field', 'email') === 'username' && isset($data['username'])) {
87 87
             $fields['username'] = $data['username'];
88 88
         }
89 89
         return User::create($fields);
Please login to merge, or discard this patch.