Completed
Branch master (d19b6f)
by Jonathan
08:09
created
app/Http/Controllers/Domain/EditController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
     /**
13 13
      * {@inheritdoc}
14 14
      */
15
-    public function save(?Domain $domain, Module $module, Request $request, bool $redirect=true)
15
+    public function save(?Domain $domain, Module $module, Request $request, bool $redirect = true)
16 16
     {
17 17
         // Default behaviour without redirection
18 18
         $record = parent::save($domain, $module, $request, false);
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
         // Redirect to detail view (we use $this->domain instead of $domain because slug could have been changed)
26 26
         if ($redirect === true) {
27
-            $route = ucroute('uccello.detail', $this->domain, $module, ['id' => $record->getKey()]);
27
+            $route = ucroute('uccello.detail', $this->domain, $module, [ 'id' => $record->getKey() ]);
28 28
 
29 29
             return redirect($route);
30 30
         }
Please login to merge, or discard this patch.
app/Http/Controllers/Settings/ModuleManagerController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,13 +38,13 @@
 block discarded – undo
38 38
         // Pre-process
39 39
         $this->preProcess($domain, $module, $request);
40 40
 
41
-        $mainModules = [];
42
-        $adminModules = [];
41
+        $mainModules = [ ];
42
+        $adminModules = [ ];
43 43
         foreach (Module::orderBy('id')->get() as $_module) {
44 44
             if ($_module->isAdminModule()) {
45
-                $adminModules[] = $_module;
45
+                $adminModules[ ] = $_module;
46 46
             } else {
47
-                $mainModules[] = $_module;
47
+                $mainModules[ ] = $_module;
48 48
             }
49 49
         }
50 50
 
Please login to merge, or discard this patch.
app/Http/Controllers/Settings/MenuManagerController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     protected function addLinksAddedAfterMenuCreation($links, $domainModules)
91 91
     {
92 92
         if (!empty($links)) {
93
-            $addedModules = [];
93
+            $addedModules = [ ];
94 94
             $this->getAddedModules($links, $addedModules);
95 95
 
96 96
             foreach ($domainModules as $module) {
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
                     $link->module = $module->name;
105 105
                     $link->color = 'grey';
106 106
                     $link->translation = uctrans($module->name, $module);
107
-                    $links[] = $link;
107
+                    $links[ ] = $link;
108 108
                 }
109 109
             }
110 110
         }
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     {
124 124
         foreach ($links as $link) {
125 125
             if (!empty($link->module) && !in_array($link->module, $addedModules)) {
126
-                $addedModules[] = $link->module;
126
+                $addedModules[ ] = $link->module;
127 127
             }
128 128
 
129 129
             if (isset($link->children) && is_array($link->children)) {
Please login to merge, or discard this patch.
app/Http/Controllers/Core/ListController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
      */
72 72
     protected function getResultForDatatable(Domain $domain, Module $module, Request $request)
73 73
     {
74
-        $draw = (int) $request->get('draw');
75
-        $start = (int) $request->get('start');
76
-        $length = (int) $request->get('length');
74
+        $draw = (int)$request->get('draw');
75
+        $start = (int)$request->get('start');
76
+        $length = (int)$request->get('length');
77 77
         $order = $request->get('order');
78 78
         $columns = $request->get('columns');
79 79
         $recordId = $request->get('id');
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
 
103 103
             // Search by column
104 104
             foreach ($columns as $column) {
105
-                $fieldName = $column["data"];
106
-                $searchValue = $column["search"]["value"];
105
+                $fieldName = $column[ "data" ];
106
+                $searchValue = $column[ "search" ][ "value" ];
107 107
 
108 108
                 // Get field by name and search by field column
109 109
                 $field = $module->getField($fieldName);
@@ -119,14 +119,14 @@  discard block
 block discarded – undo
119 119
 
120 120
             // Order results
121 121
             foreach ($order as $orderInfo) {
122
-                $columnIndex = (int) $orderInfo["column"];
123
-                $column = $columns[$columnIndex];
124
-                $fieldName = $column["data"];
122
+                $columnIndex = (int)$orderInfo[ "column" ];
123
+                $column = $columns[ $columnIndex ];
124
+                $fieldName = $column[ "data" ];
125 125
 
126 126
                 // Get field by name and order by field column
127 127
                 $field = $module->getField($fieldName);
128 128
                 if (!is_null($field)) {
129
-                    $query = $query->orderBy($field->column, $orderInfo["dir"]);
129
+                    $query = $query->orderBy($field->column, $orderInfo[ "dir" ]);
130 130
                 }
131 131
             }
132 132
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                 if ($relatedList && $relatedList->method) {
139 139
                     // Related list method
140 140
                     $method = $relatedList->method;
141
-                    $countMethod = $method . 'Count';
141
+                    $countMethod = $method.'Count';
142 142
 
143 143
                     // Update query
144 144
                     $model = new $modelClass;
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
             $data = $records;
167 167
 
168 168
         } else {
169
-            $data = [];
169
+            $data = [ ];
170 170
             $total = 0;
171 171
             $totalFiltered = 0;
172 172
         }
Please login to merge, or discard this patch.
app/Http/Controllers/Core/SwaggerController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
20 20
     public function docs($jsonFile = null)
21 21
     {
22 22
         $filePath = config('l5-swagger.paths.docs').'/'.
23
-            (! is_null($jsonFile) ? $jsonFile : config('l5-swagger.paths.docs_json', 'api-docs.json'));
23
+            (!is_null($jsonFile) ? $jsonFile : config('l5-swagger.paths.docs_json', 'api-docs.json'));
24 24
 
25
-        if (! File::exists($filePath)) {
25
+        if (!File::exists($filePath)) {
26 26
             try {
27 27
                 Generator::generateDocs();
28 28
             } catch (\Exception $e) {
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
         }
50 50
 
51 51
         if ($proxy = config('l5-swagger.proxy')) {
52
-            if (! is_array($proxy)) {
53
-                $proxy = [$proxy];
52
+            if (!is_array($proxy)) {
53
+                $proxy = [ $proxy ];
54 54
             }
55 55
 
56 56
             Request::setTrustedProxies($proxy, \Illuminate\Http\Request::HEADER_X_FORWARDED_ALL);
Please login to merge, or discard this patch.
app/Http/Controllers/Core/EditController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      * @param boolean $redirect
69 69
      * @return void
70 70
      */
71
-    public function save(?Domain $domain, Module $module, Request $request, bool $redirect=true)
71
+    public function save(?Domain $domain, Module $module, Request $request, bool $redirect = true)
72 72
     {
73 73
         // Pre-process
74 74
         $this->preProcess($domain, $module, $request);
@@ -109,15 +109,15 @@  discard block
 block discarded – undo
109 109
         if ($redirect === true) {
110 110
             // Redirect to source record if a relation was made
111 111
             if (isset($relatedlist) && $redirectToSourceRecord === true) {
112
-                $params = ['id' => $sourceRecordId];
112
+                $params = [ 'id' => $sourceRecordId ];
113 113
 
114 114
                 // Add tab id if defined to select it automaticaly
115 115
                 if ($tabId) {
116
-                    $params['tab'] = $tabId;
116
+                    $params[ 'tab' ] = $tabId;
117 117
                 }
118 118
                 // Add related list id to select the related tab automaticaly
119 119
                 else {
120
-                    $params['relatedlist'] = $relatedlist->id;
120
+                    $params[ 'relatedlist' ] = $relatedlist->id;
121 121
                 }
122 122
 
123 123
                 $route = ucroute('uccello.detail', $domain, $relatedlist->module, $params);
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
             }
130 130
             // Else redirect to detail
131 131
             else {
132
-                $route = ucroute('uccello.detail', $domain, $module, ['id' => $record->getKey()]);
132
+                $route = ucroute('uccello.detail', $domain, $module, [ 'id' => $record->getKey() ]);
133 133
             }
134 134
 
135 135
             return redirect($route);
Please login to merge, or discard this patch.
app/Http/Controllers/Core/DetailController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@
 block discarded – undo
31 31
         $recordId = $request->input('id');
32 32
 
33 33
         // Selected tab
34
-        $selectedTabId = (int) $request->input('tab');
34
+        $selectedTabId = (int)$request->input('tab');
35 35
 
36 36
         // Selected related list
37
-        $selectedRelatedlistId = (int) $request->input('relatedlist');
37
+        $selectedRelatedlistId = (int)$request->input('relatedlist');
38 38
 
39 39
         return $this->autoView([
40 40
             'record' => $this->getRecord($recordId),
Please login to merge, or discard this patch.
app/Http/Controllers/Core/DeleteController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -68,15 +68,15 @@
 block discarded – undo
68 68
 
69 69
         // Redirect to source record if a relation was deleted
70 70
         if (isset($relatedlist) && $request->input('src_id')) {
71
-            $params = ['id' => $request->input('src_id')];
71
+            $params = [ 'id' => $request->input('src_id') ];
72 72
 
73 73
             // Add tab id if defined to select it automaticaly
74 74
             if ($request->input('tab')) {
75
-                $params['tab'] = $request->input('tab');
75
+                $params[ 'tab' ] = $request->input('tab');
76 76
             }
77 77
             // Add related list id to select the related tab automaticaly
78 78
             else {
79
-                $params['relatedlist'] = $relatedlist->id;
79
+                $params[ 'relatedlist' ] = $relatedlist->id;
80 80
             }
81 81
 
82 82
             $route = ucroute('uccello.detail', $domain, $relatedlist->module, $params);
Please login to merge, or discard this patch.
app/Http/Controllers/Core/Controller.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
      */
146 146
     protected function getAllModules($getAdminModules = false)
147 147
     {
148
-        $modules = [];
148
+        $modules = [ ];
149 149
 
150 150
         $allModules = Module::all();
151 151
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
         } else {
155 155
             foreach ($allModules as $module) {
156 156
                 if (!$module->isAdminModule()) {
157
-                    $modules[] = $module;
157
+                    $modules[ ] = $module;
158 158
                 }
159 159
             }
160 160
         }
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 
179 179
         // An id is defined, retrieve the record from the database fail (404)
180 180
         if ($this->request->has('id')) {
181
-            $recordId = (int) $this->request->input('id');
181
+            $recordId = (int)$this->request->input('id');
182 182
             $record = $modelClass::findOrFail($recordId);
183 183
         }
184 184
         // Make a new empty instance
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
      * @param  array   $mergeData
202 202
      * @return \Illuminate\View\View|\Illuminate\Contracts\View\Factory
203 203
      */
204
-    protected function autoView($data = [], $mergeData = [])
204
+    protected function autoView($data = [ ], $mergeData = [ ])
205 205
     {
206 206
         $viewToUse = uccello()->view($this->module->package, $this->module, $this->viewName);
207 207
 
Please login to merge, or discard this patch.