Passed
Push — master ( 340202...35f943 )
by Jonathan
19:55
created
app/Support/Traits/UccelloModule.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,15 +56,15 @@
 block discarded – undo
56 56
 
57 57
     protected static function getModuleFromClass($className)
58 58
     {
59
-        $modules = Cache::rememberForever('modules_by_model_class', function () {
59
+        $modules = Cache::rememberForever('modules_by_model_class', function() {
60 60
             $modulesGroupedByModelClass = collect();
61
-            Module::all()->map(function ($item) use ($modulesGroupedByModelClass) {
62
-                $modulesGroupedByModelClass[$item->model_class] = $item;
61
+            Module::all()->map(function($item) use ($modulesGroupedByModelClass) {
62
+                $modulesGroupedByModelClass[ $item->model_class ] = $item;
63 63
                 return $modulesGroupedByModelClass;
64 64
             });
65 65
             return $modulesGroupedByModelClass;
66 66
         });
67
-        return $modules[(string) $className] ?? null;
67
+        return $modules[ (string)$className ] ?? null;
68 68
     }
69 69
 
70 70
     public function getUuidAttribute()
Please login to merge, or discard this patch.
app/Http/Controllers/Core/ListController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             ->get();
52 52
 
53 53
         // Order by
54
-        $filterOrderBy = (array) $selectedFilter->order;
54
+        $filterOrderBy = (array)$selectedFilter->order;
55 55
 
56 56
         return $this->autoView(compact('datatableColumns', 'filters', 'selectedFilter', 'filterOrderBy'));
57 57
     }
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
             if ($relatedList && $relatedList->method) {
114 114
                 // Related list method
115 115
                 $method = $relatedList->method;
116
-                $recordIdsMethod = $method . 'RecordIds';
116
+                $recordIdsMethod = $method.'RecordIds';
117 117
 
118 118
                 // Get related records ids
119 119
                 $model = new $modelClass;
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 
122 122
                 // Add the record id itself to be filtered
123 123
                 if ($relatedList->module_id === $relatedList->related_module_id && !empty($recordId) && !$filteredRecordIds->contains($recordId)) {
124
-                    $filteredRecordIds[] = (int)$recordId;
124
+                    $filteredRecordIds[ ] = (int)$recordId;
125 125
                 }
126 126
 
127 127
                 // Make the quer
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
             $records = $query->paginate($length);
133 133
         }
134 134
 
135
-        $records->getCollection()->transform(function ($record) use ($domain, $module) {
135
+        $records->getCollection()->transform(function($record) use ($domain, $module) {
136 136
             foreach ($module->fields as $field) {
137 137
                 // If a special template exists, use it. Else use the generic template
138 138
                 $uitype = uitype($field->uitype_id);
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
         $results = collect();
177 177
         if (method_exists($modelClass, 'getSearchResult') && property_exists($modelClass, 'searchableColumns')) {
178 178
             $searchResults = new Search();
179
-            $searchResults->registerModel($modelClass, (array) (new $modelClass)->searchableColumns);
179
+            $searchResults->registerModel($modelClass, (array)(new $modelClass)->searchableColumns);
180 180
             $results = $searchResults->search($q)->take(config('uccello.max_results.autocomplete', 10));
181 181
         }
182 182
 
@@ -197,9 +197,9 @@  discard block
 block discarded – undo
197 197
         $savePageLength = $request->input('save_page_length');
198 198
 
199 199
         // Optional data
200
-        $data = [];
200
+        $data = [ ];
201 201
         if ($savePageLength) {
202
-            $data["length"] = $request->input('page_length');
202
+            $data[ "length" ] = $request->input('page_length');
203 203
         }
204 204
 
205 205
         $filter = Filter::firstOrNew([
Please login to merge, or discard this patch.
app/Http/Controllers/Core/ExportController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
         // With conditions
64 64
         if ($request->input('with_conditions') === '1') {
65 65
             // TODO: Build $conditions['search'] earlier in the export process to match filter format...
66
-            $conditions = ['search' => json_decode($request->input('conditions'))];
66
+            $conditions = [ 'search' => json_decode($request->input('conditions')) ];
67 67
             $export = $export->withConditions($conditions);
68 68
         }
69 69
 
Please login to merge, or discard this patch.
database/migrations/2018_04_15_000035_alter_filter_module.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
      */
26 26
     public function down()
27 27
     {
28
-        Schema::table($this->tablePrefix . 'filters', function (Blueprint $table) {
28
+        Schema::table($this->tablePrefix.'filters', function(Blueprint $table) {
29 29
             $table->renameColumn('order', 'order_by');
30 30
         });
31 31
     }
Please login to merge, or discard this patch.
resources/views/modules/default/detail/relatedlists/table.blade.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <div class="autoscroll-x">
2
-    <?php $filterOrder = !empty($selectedFilter) ? (array) $selectedFilter->order : []; ?>
2
+    <?php $filterOrder = !empty($selectedFilter) ? (array)$selectedFilter->order : [ ]; ?>
3 3
     <table
4 4
         id="{{ $datatableId }}"
5 5
         class="striped highlight"
@@ -31,15 +31,15 @@  discard block
 block discarded – undo
31 31
                     <div class="search hide-on-small-only hide-on-med-only">
32 32
                         <?php
33 33
                             $searchValue = null;
34
-                            if (!empty($selectedFilter) && !empty($selectedFilter->conditions->search->{$column['name']})) {
35
-                                $searchValue = $selectedFilter->conditions->search->{$column['name']};
34
+                            if (!empty($selectedFilter) && !empty($selectedFilter->conditions->search->{$column[ 'name' ]})) {
35
+                                $searchValue = $selectedFilter->conditions->search->{$column[ 'name' ]};
36 36
                             }
37 37
 
38 38
                             // If a special template exists, use it. Else use the generic template
39 39
                             $uitypeViewName = sprintf('uitypes.search.%s', $column[ 'uitype' ]);
40 40
                             $uitypeFallbackView = 'uccello::modules.default.uitypes.search.text';
41 41
                             $uitypeViewToInclude = uccello()->view($column[ 'package' ], $module, $uitypeViewName, $uitypeFallbackView);
42
-                            $field = $module->fields()->where('name', $column['name'])->first();
42
+                            $field = $module->fields()->where('name', $column[ 'name' ])->first();
43 43
                         ?>
44 44
                         @include($uitypeViewToInclude, [ 'field' => $field ])
45 45
                     </div>
Please login to merge, or discard this patch.
app/Support/Traits/RelatedlistTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     {
34 34
         // Related field
35 35
         $relatedField = $relatedList->relatedField;
36
-        $filter = ['order' => request('order')];
36
+        $filter = [ 'order' => request('order') ];
37 37
 
38 38
         $query = $query->where($relatedField->column, $recordId)
39 39
                         ->filterBy($filter);
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $relationName = $relatedList->relationName;
75 75
 
76 76
         $record = $modelClass::find($recordId);
77
-        $filter = ['order' => request('order')];
77
+        $filter = [ 'order' => request('order') ];
78 78
 
79 79
         $query = $record->$relationName()
80 80
                         ->filterBy($filter);
Please login to merge, or discard this patch.
app/Models/Filter.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -78,24 +78,24 @@
 block discarded – undo
78 78
             $filter = new static();
79 79
 
80 80
             // Refactor $data to mach match 'conditions' filter format...
81
-            if(!empty($data['columns']) && is_array($data['columns']) && is_array(reset($data['columns'])))
81
+            if (!empty($data[ 'columns' ]) && is_array($data[ 'columns' ]) && is_array(reset($data[ 'columns' ])))
82 82
             {
83
-                if (empty($data['conditions'])) {
84
-                    $data['conditions'] = [];
83
+                if (empty($data[ 'conditions' ])) {
84
+                    $data[ 'conditions' ] = [ ];
85 85
                 }
86 86
                 else {
87
-                    $data['conditions'] = (array) $data['conditions'];
87
+                    $data[ 'conditions' ] = (array)$data[ 'conditions' ];
88 88
                 }
89 89
 
90
-                foreach ($data['columns'] as $fieldName => $field) {
90
+                foreach ($data[ 'columns' ] as $fieldName => $field) {
91 91
                     foreach ($field as $key => $value) {
92 92
                         if (!empty($value) && $key != 'columnName') {
93
-                            $data['conditions'][$key][$fieldName] = $value;
93
+                            $data[ 'conditions' ][ $key ][ $fieldName ] = $value;
94 94
                         }
95 95
                     }
96 96
                 }
97 97
 
98
-                unset($data['columns']);
98
+                unset($data[ 'columns' ]);
99 99
             }
100 100
 
101 101
             foreach ($data as $key => $value) {
Please login to merge, or discard this patch.
app/Http/Controllers/Core/DomainsTreeController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@  discard block
 block discarded – undo
20 20
 
21 21
         $rootDomains = app('uccello')->getRootDomains();
22 22
 
23
-        $domains = [];
23
+        $domains = [ ];
24 24
         foreach ($rootDomains as $_domain) {
25 25
             $formattedDomain = $this->getFormattedDomainToAdd($domain, $_domain);
26 26
             if ($formattedDomain) {
27
-                $domains[] = $formattedDomain;
27
+                $domains[ ] = $formattedDomain;
28 28
             }
29 29
         }
30 30
 
@@ -45,12 +45,12 @@  discard block
 block discarded – undo
45 45
 
46 46
         $parentDomain = Domain::find(request('id'));
47 47
 
48
-        $domains = [];
48
+        $domains = [ ];
49 49
         if ($parentDomain) {
50 50
             foreach ($parentDomain->children()->orderBy('name')->get() as $_domain) {
51 51
                 $formattedDomain = $this->getFormattedDomainToAdd($domain, $_domain);
52 52
                 if ($formattedDomain) {
53
-                    $domains[] = $formattedDomain;
53
+                    $domains[ ] = $formattedDomain;
54 54
                 }
55 55
             }
56 56
         }
Please login to merge, or discard this patch.
app/Http/Controllers/Core/Controller.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      * @param Module $module
76 76
      * @param boolean $forBlade
77 77
      */
78
-    protected function preProcess(?Domain &$domain, Module $module, Request $request, $forBlade=true)
78
+    protected function preProcess(?Domain &$domain, Module $module, Request $request, $forBlade = true)
79 79
     {
80 80
         // If we don't use multi domains, find the first one
81 81
         if (!uccello()->useMultiDomains()) {
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
     {
154 154
         $keyName = $getAdminModules ? 'modules_all' : 'modules_not_admin';
155 155
 
156
-        return Cache::rememberForever($keyName, function () use($getAdminModules) {
156
+        return Cache::rememberForever($keyName, function() use($getAdminModules) {
157 157
             $modules = [ ];
158 158
 
159 159
             $allModules = Module::all();
Please login to merge, or discard this patch.