Passed
Push — master ( db1581...a5af1f )
by Ferry
04:30
created
src/configs/crudbooster.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@
 block discarded – undo
30 30
     /*
31 31
      * For security reason we have limit the upload file formats bellow
32 32
      */
33
-    'UPLOAD_FILE_EXTENSION_ALLOWED' => ['jpg','jpeg','png','gif','pdf','xls','xlsx','doc','docx','txt','zip','rar','rtf'],
33
+    'UPLOAD_FILE_EXTENSION_ALLOWED' => ['jpg', 'jpeg', 'png', 'gif', 'pdf', 'xls', 'xlsx', 'doc', 'docx', 'txt', 'zip', 'rar', 'rtf'],
34 34
 
35
-    'UPLOAD_IMAGE_EXTENSION_ALLOWED' => ['jpg','jpeg','png','gif'],
35
+    'UPLOAD_IMAGE_EXTENSION_ALLOWED' => ['jpg', 'jpeg', 'png', 'gif'],
36 36
 
37 37
     /*
38 38
      * Google FCM Server Key is used to send a notification via FireBase cloud message
Please login to merge, or discard this patch.
src/controllers/traits/ControllerSetting.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
      * @param ButtonColor $color
85 85
      * @param string $attributes
86 86
      */
87
-    public function addIndexActionButton($label, $actionURL, $fontAwesome_icon=null, $color=null, $attributes = null)
87
+    public function addIndexActionButton($label, $actionURL, $fontAwesome_icon = null, $color = null, $attributes = null)
88 88
     {
89
-        $color = ($color)?:ButtonColor::DARK_BLUE;
89
+        $color = ($color) ?: ButtonColor::DARK_BLUE;
90 90
 
91 91
         $model = new IndexActionButtonModel();
92 92
         $model->setLabel($label);
@@ -128,12 +128,12 @@  discard block
 block discarded – undo
128 128
      * @param $fontAwesome_icon
129 129
      * @param ButtonColor|string $color
130 130
      */
131
-    public function addActionButton($label, $url_target, $condition_callback=null, $fontAwesome_icon=null, $color=null, $confirmation = false)
131
+    public function addActionButton($label, $url_target, $condition_callback = null, $fontAwesome_icon = null, $color = null, $confirmation = false)
132 132
     {
133 133
         $new = new AddActionButtonModel();
134 134
         $new->setLabel($label);
135
-        $new->setIcon($fontAwesome_icon?:"fa fa-bars");
136
-        $new->setColor($color?:"primary");
135
+        $new->setIcon($fontAwesome_icon ?: "fa fa-bars");
136
+        $new->setColor($color ?: "primary");
137 137
         $new->setUrl($url_target);
138 138
         $new->setCondition($condition_callback);
139 139
         $new->setConfirmation($confirmation);
Please login to merge, or discard this patch.
src/controllers/FileController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         $fullStoragePath = storage_path('app/'.$fullFilePath);
35 35
         $lifetime = 31556926; // One year in seconds
36 36
 
37
-        if (! Storage::exists($fullFilePath)) {
37
+        if (!Storage::exists($fullFilePath)) {
38 38
             abort(404);
39 39
         }
40 40
 
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
                 $h = Request::get('h') ?: $w;
56 56
             }
57 57
 
58
-            $imgRaw = Image::cache(function ($image) use ($fullStoragePath, $w, $h) {
58
+            $imgRaw = Image::cache(function($image) use ($fullStoragePath, $w, $h) {
59 59
                 $im = $image->make($fullStoragePath);
60 60
                 if ($w) {
61
-                    if (! $h) {
61
+                    if (!$h) {
62 62
                         $im->fit($w);
63 63
                     } else {
64 64
                         $im->fit($w, $h);
Please login to merge, or discard this patch.
src/controllers/AdminProfileController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     }
14 14
 
15 15
     public function postUpdate() {
16
-        validator(request()->all(),[
16
+        validator(request()->all(), [
17 17
             'name'=>'required|max:255|min:3',
18 18
             'email'=>'required|email',
19 19
             'photo'=>'image',
@@ -24,19 +24,19 @@  discard block
 block discarded – undo
24 24
             $data = [];
25 25
             $data['name'] = request('name');
26 26
             $data['email'] = request('email');
27
-            if(request()->has('password')) {
27
+            if (request()->has('password')) {
28 28
                 $data['password'] = Hash::make(request('password'));
29 29
             }
30
-            if(request()->hasFile('photo')) {
30
+            if (request()->hasFile('photo')) {
31 31
                 $data['photo'] = cb()->uploadFile('photo', true, 200, 200);
32 32
             }
33 33
             DB::table("users")->where("id", auth()->id())->update($data);
34
-        }catch (\Exception $e) {
34
+        } catch (\Exception $e) {
35 35
             Log::error($e);
36
-            return cb()->redirectBack("Something went wrong!","warning");
36
+            return cb()->redirectBack("Something went wrong!", "warning");
37 37
         }
38 38
 
39
-        return cb()->redirectBack("The profile data has been updated!","success");
39
+        return cb()->redirectBack("The profile data has been updated!", "success");
40 40
     }
41 41
 
42 42
 }
Please login to merge, or discard this patch.
src/helpers/UserSession.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php 
2 2
 namespace crocodicstudio\crudbooster\helpers;
3 3
 
4
-class UserSession  {
4
+class UserSession {
5 5
 
6 6
     public function user()
7 7
     {
@@ -21,14 +21,14 @@  discard block
 block discarded – undo
21 21
     public function photo()
22 22
     {
23 23
         $user = $this->user();
24
-        return ($user->photo)?asset($user->photo):asset(dummyPhoto());
24
+        return ($user->photo) ?asset($user->photo) : asset(dummyPhoto());
25 25
     }
26 26
 
27 27
     public function roleName()
28 28
     {
29 29
         $user = $this->user();
30 30
         $role = cb()->find("cb_roles", $user->roles_id);
31
-        if($role) return $role->name;
31
+        if ($role) return $role->name;
32 32
         else return null;
33 33
     }
34 34
 
Please login to merge, or discard this patch.
src/helpers/MailHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
     }
42 42
 
43 43
     public function send() {
44
-        Mail::send("crudbooster::emails.blank", ['content' => $this->content], function ($message) {
44
+        Mail::send("crudbooster::emails.blank", ['content' => $this->content], function($message) {
45 45
             $message->priority(1);
46 46
             $message->to($this->to_email);
47 47
             $message->from($this->sender_email, $this->sender_name);
Please login to merge, or discard this patch.
src/commands/Install.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 
39 39
         if ($this->confirm('Do you have setting the database configuration at .env ?')) {
40 40
 
41
-            if (! file_exists(public_path('vendor')) ) {
41
+            if (!file_exists(public_path('vendor'))) {
42 42
                 mkdir(public_path('vendor'), 0777);
43 43
             }
44 44
 
Please login to merge, or discard this patch.
src/types/checkbox/Hook.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
      */
21 21
     public function assignment($value, $column)
22 22
     {
23
-        return implode(";", request( $column->getName() ));
23
+        return implode(";", request($column->getName()));
24 24
     }
25 25
 
26 26
 }
27 27
\ No newline at end of file
Please login to merge, or discard this patch.
src/types/checkbox/CheckboxHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 class CheckboxHelper
12 12
 {
13 13
     public static function parseValuesToArray($values) {
14
-        $data = explode(";",$values);
14
+        $data = explode(";", $values);
15 15
         return $data;
16 16
     }
17 17
     
Please login to merge, or discard this patch.