Passed
Push — master ( 5824e9...9b15e8 )
by Jonathan
16:39
created
app/Models/Entity.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,11 +25,11 @@
 block discarded – undo
25 25
         'creator_id',
26 26
     ];
27 27
 
28
-    protected $primaryKey = 'id';   // TODO: Change to "uid" to make joins withs modules tables possible ???
28
+    protected $primaryKey = 'id'; // TODO: Change to "uid" to make joins withs modules tables possible ???
29 29
     public $incrementing = false;
30 30
 
31 31
     // Allow Eloquent to return id as string instead of int.
32
-    protected $casts = ['id' => 'string'];
32
+    protected $casts = [ 'id' => 'string' ];
33 33
 
34 34
     protected function initTablePrefix()
35 35
     {
Please login to merge, or discard this patch.
app/Fields/Uitype/Choice.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     public function getFormattedValueToDisplay(Field $field, $record) : string
76 76
     {
77 77
         if (isset($field->data->multiple) && $field->data->multiple === true && !empty($record->{$field->column})) {
78
-            $values = [];
78
+            $values = [ ];
79 79
 
80 80
             $fieldValues = json_decode($record->{$field->column});
81 81
             if (is_array($fieldValues)) {
@@ -84,13 +84,13 @@  discard block
 block discarded – undo
84 84
                         continue;
85 85
                     }
86 86
 
87
-                    $values[] =  uctrans($value, $field->module);
87
+                    $values[ ] = uctrans($value, $field->module);
88 88
                 }
89 89
             }
90 90
 
91 91
             $value = implode(', ', $values);
92 92
         } else {
93
-            $value =  parent::getFormattedValueToDisplay($field, $record);
93
+            $value = parent::getFormattedValueToDisplay($field, $record);
94 94
         }
95 95
 
96 96
         return $value;
Please login to merge, or discard this patch.
app/Http/Controllers/Core/TreeController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
         $roots = collect();
61 61
         foreach ($rootRecords as $record) {
62
-            $roots[] = $this->getFormattedRecordToAdd($record);
62
+            $roots[ ] = $this->getFormattedRecordToAdd($record);
63 63
         }
64 64
 
65 65
         return $roots;
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         $children = collect();
86 86
         if ($parentRecord) {
87 87
             foreach ($parentRecord->children()->get() as $record) {
88
-                $children[] = $this->getFormattedRecordToAdd($record);
88
+                $children[ ] = $this->getFormattedRecordToAdd($record);
89 89
             }
90 90
         }
91 91
 
Please login to merge, or discard this patch.
resources/views/modules/default/uitypes/edit/file.blade.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
     @if ($value)
17 17
         <?php
18 18
             $valueParts = explode(';', $value);
19
-            $fileName = $valueParts[0];
19
+            $fileName = $valueParts[ 0 ];
20 20
         ?>
21 21
         <div class="input-field current-file">
22 22
             <div class="file-container">
Please login to merge, or discard this patch.
app/Support/Traits/WithRoles.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
         foreach ($treeDomainsIds as $treeDomainId) {
45 45
             $_domain = Domain::find($treeDomainId);
46 46
             foreach ($_domain->roles as $role) {
47
-                $roleName = $_domain->id === $domain->id ? $role->name : $_domain->name . ' > ' . $role->name;
47
+                $roleName = $_domain->id === $domain->id ? $role->name : $_domain->name.' > '.$role->name;
48 48
                 $roles[ $role->id ] = $roleName;
49 49
             }
50 50
         }
Please login to merge, or discard this patch.
app/Models/Module.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -176,8 +176,8 @@
 block discarded – undo
176 176
             }
177 177
             // Several routes
178 178
             elseif (is_array($this->data->menu)) {
179
-                if (!empty($this->data->menu[0]->route)) {
180
-                    $defaultRoute = $this->data->menu[0]->route;
179
+                if (!empty($this->data->menu[ 0 ]->route)) {
180
+                    $defaultRoute = $this->data->menu[ 0 ]->route;
181 181
                 }
182 182
             }
183 183
         }
Please login to merge, or discard this patch.
app/Support/Scopes/AssignedUser.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
             $builder->whereIn($model->getTable().'.assigned_user_id', $user->getAllowedGroupUuids());
28 28
 
29 29
             // Records assigned to an user with roles subordonate to the roles of the user
30
-            $builder->orWhereIn($model->getTable().'.assigned_user_id', function ($query) use ($user) {
30
+            $builder->orWhereIn($model->getTable().'.assigned_user_id', function($query) use ($user) {
31 31
                 $entityTable = with(new Entity)->getTable();
32 32
                 $privilegesTable = env('UCCELLO_TABLE_PREFIX', 'uccello_').'privileges';
33 33
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
                 $query->select($entityTable.'.id')
38 38
                     ->from($entityTable)
39
-                    ->join($privilegesTable, function ($join) use($entityTable, $privilegesTable, $subordonateRolesIds) {
39
+                    ->join($privilegesTable, function($join) use($entityTable, $privilegesTable, $subordonateRolesIds) {
40 40
                         $join->on("$privilegesTable.user_id", '=', $entityTable.'.record_id')
41 41
                         ->whereIn("$privilegesTable.role_id", $subordonateRolesIds);
42 42
                     })
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
             // Records created by the user
47 47
             if (!empty($model->module)) {
48
-                $builder->orWhereIn($model->getTable().'.'.$model->getKeyName(), function ($query) use($model) {
48
+                $builder->orWhereIn($model->getTable().'.'.$model->getKeyName(), function($query) use($model) {
49 49
                     $query->select('record_id')
50 50
                     ->from(with(new Entity)->getTable())
51 51
                     ->where('module_id', $model->module->id ?? null)
Please login to merge, or discard this patch.
app/Http/Controllers/Core/PopupEditController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,9 +74,9 @@
 block discarded – undo
74 74
             }
75 75
         }
76 76
         // Redirect if form not valid
77
-        if (! $form->isValid()) {
77
+        if (!$form->isValid()) {
78 78
             ucnotify(uctrans('notification.form.not_valid', $module), 'error');
79
-            $response = redirect(route('uccello.popup.edit', ['domain' => $domain->slug, 'module' => $module->name]));
79
+            $response = redirect(route('uccello.popup.edit', [ 'domain' => $domain->slug, 'module' => $module->name ]));
80 80
             $response = $response->withErrors($form->getErrors(), $form->getErrorBag())->withInput();
81 81
             return $response;
82 82
         }
Please login to merge, or discard this patch.
app/Http/Controllers/Core/ListController.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -51,17 +51,17 @@  discard block
 block discarded – undo
51 51
         // Get filters
52 52
         $filters = Filter::where('module_id', $module->id)  // Module
53 53
             ->where('type', 'list')                         // Type (list)
54
-            ->where(function ($query) use($domain) {        // Domain
54
+            ->where(function($query) use($domain) {        // Domain
55 55
                 $query->whereNull('domain_id')
56 56
                     ->orWhere('domain_id', $domain->getKey());
57 57
             })
58
-            ->where(function ($query) {                     // User
58
+            ->where(function($query) {                     // User
59 59
                 $query->where('is_public', true)
60
-                    ->orWhere(function ($query) {
60
+                    ->orWhere(function($query) {
61 61
                         $query->where('is_public', false)
62 62
                             ->where('user_id', '=', auth()->id());
63 63
                     })
64
-                    ->orWhere(function ($query) {
64
+                    ->orWhere(function($query) {
65 65
                         $query->where('is_public', false)
66 66
                             ->whereNull('user_id');
67 67
                     });
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             ->get();
71 71
 
72 72
         // Order
73
-        $filterOrder = (array) $selectedFilter->order;
73
+        $filterOrder = (array)$selectedFilter->order;
74 74
 
75 75
         // See descendants
76 76
         $seeDescendants = request()->session()->get('descendants');
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
             if ($relatedList && $relatedList->method) {
155 155
                 // Related list method
156 156
                 $method = $relatedList->method;
157
-                $recordIdsMethod = $method . 'RecordIds';
157
+                $recordIdsMethod = $method.'RecordIds';
158 158
 
159 159
                 // Get related records ids
160 160
                 $model = new $modelClass;
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 
163 163
                 // Add the record id itself to be filtered
164 164
                 if ($relatedList->module_id === $relatedList->related_module_id && !empty($recordId) && !$filteredRecordIds->contains($recordId)) {
165
-                    $filteredRecordIds[] = (int)$recordId;
165
+                    $filteredRecordIds[ ] = (int)$recordId;
166 166
                 }
167 167
 
168 168
                 if ($relatedList->module_id) {
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
             $records = $query->paginate($length);
178 178
         }
179 179
 
180
-        $records->getCollection()->transform(function ($record) use ($domain, $module, $relatedModule) {
180
+        $records->getCollection()->transform(function($record) use ($domain, $module, $relatedModule) {
181 181
             foreach ($module->fields as $field) {
182 182
                 // If a special template exists, use it. Else use the generic template
183 183
                 $uitype = uitype($field->uitype_id);
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
         $results = collect();
229 229
         if (method_exists($modelClass, 'getSearchResult') && property_exists($modelClass, 'searchableColumns')) {
230 230
             $searchResults = new Search();
231
-            $searchResults->registerModel($modelClass, (array) (new $modelClass)->searchableColumns);
231
+            $searchResults->registerModel($modelClass, (array)(new $modelClass)->searchableColumns);
232 232
             $results = $searchResults->search($q)->take(config('uccello.max_results.autocomplete', 10));
233 233
         }
234 234
 
@@ -249,9 +249,9 @@  discard block
 block discarded – undo
249 249
         $savePageLength = $request->input('save_page_length');
250 250
 
251 251
         // Optional data
252
-        $data = [];
252
+        $data = [ ];
253 253
         if ($savePageLength) {
254
-            $data["length"] = $request->input('page_length');
254
+            $data[ "length" ] = $request->input('page_length');
255 255
         }
256 256
 
257 257
         $filter = Filter::firstOrNew([
@@ -343,9 +343,9 @@  discard block
 block discarded – undo
343 343
     protected function addSearchConditions($filter)
344 344
     {
345 345
         if ($this->request->has('search')) {
346
-            $conditions = [];
347
-            foreach ((array) $this->request->search as $fieldName => $value) {
348
-                $conditions[$fieldName] = $value;
346
+            $conditions = [ ];
347
+            foreach ((array)$this->request->search as $fieldName => $value) {
348
+                $conditions[ $fieldName ] = $value;
349 349
             }
350 350
 
351 351
             if ($conditions) {
Please login to merge, or discard this patch.