@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | protected $tablePrefix; |
13 | 13 | |
14 | - public function __construct(array $attributes = []) |
|
14 | + public function __construct(array $attributes = [ ]) |
|
15 | 15 | { |
16 | 16 | parent::__construct($attributes); |
17 | 17 | |
@@ -34,9 +34,9 @@ discard block |
||
34 | 34 | |
35 | 35 | protected function initTableName() |
36 | 36 | { |
37 | - if($this->table) |
|
37 | + if ($this->table) |
|
38 | 38 | { |
39 | - $this->table = $this->tablePrefix . $this->table; |
|
39 | + $this->table = $this->tablePrefix.$this->table; |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | } |
43 | 43 | \ No newline at end of file |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @see Uccello\Core\Helpers\Uccello |
28 | 28 | */ |
29 | - function uctrans($key = null, ? Module $module = null, $replace = [], $locale = null) |
|
29 | + function uctrans($key = null, ? Module $module = null, $replace = [ ], $locale = null) |
|
30 | 30 | { |
31 | 31 | return app('uccello')->trans($key, $module, $replace, $locale); |
32 | 32 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * @param boolean $absolute |
57 | 57 | * @return string |
58 | 58 | */ |
59 | - function ucroute($name, $domain = null, $module = null, $parameters = [], $absolute = true) : string |
|
59 | + function ucroute($name, $domain = null, $module = null, $parameters = [ ], $absolute = true) : string |
|
60 | 60 | { |
61 | 61 | return app('uccello')->route($name, $domain, $module, $parameters, $absolute); |
62 | 62 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @param string $package |
123 | 123 | * @return void |
124 | 124 | */ |
125 | - function ucasset($path, $package='uccello') |
|
125 | + function ucasset($path, $package = 'uccello') |
|
126 | 126 | { |
127 | 127 | return asset("vendor/uccello/$package/$path"); |
128 | 128 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * @param string $locale |
34 | 34 | * @return \Illuminate\Contracts\Translation\Translator|string|array|null |
35 | 35 | */ |
36 | - public function trans($key = null, ?Module $module = null, $replace = [], $locale = null) |
|
36 | + public function trans($key = null, ?Module $module = null, $replace = [ ], $locale = null) |
|
37 | 37 | { |
38 | 38 | if (is_null($key)) { |
39 | 39 | return app('translator'); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | // If a package name is defined add it before |
49 | 49 | if (!empty($module->package)) { |
50 | - $prefix = $module->package . '::'. $prefix; |
|
50 | + $prefix = $module->package.'::'.$prefix; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | // Get translation |
@@ -92,22 +92,22 @@ discard block |
||
92 | 92 | public function view(string $package, Module $module, string $viewName, ?string $fallbackView = null): ?string |
93 | 93 | { |
94 | 94 | // Module view overrided in app |
95 | - $appModuleView = 'modules.' . $module->name . '.' . $viewName; |
|
95 | + $appModuleView = 'modules.'.$module->name.'.'.$viewName; |
|
96 | 96 | |
97 | 97 | // Default view overrided in app |
98 | - $appDefaultView = 'modules.default.' . $viewName; |
|
98 | + $appDefaultView = 'modules.default.'.$viewName; |
|
99 | 99 | |
100 | 100 | // Module view ovverrided in package |
101 | - $packageModuleView = $package . '::modules.' . $module->name . '.' . $viewName; |
|
101 | + $packageModuleView = $package.'::modules.'.$module->name.'.'.$viewName; |
|
102 | 102 | |
103 | 103 | // Default view defined in package |
104 | - $packageDefaultView = $package . '::modules.default.' . $viewName; |
|
104 | + $packageDefaultView = $package.'::modules.default.'.$viewName; |
|
105 | 105 | |
106 | 106 | // Module view ovverrided in uccello |
107 | - $uccelloModuleView = 'uccello::modules.' . $module->name . '.' . $viewName; |
|
107 | + $uccelloModuleView = 'uccello::modules.'.$module->name.'.'.$viewName; |
|
108 | 108 | |
109 | 109 | // Default view defined in uccello |
110 | - $uccelloDefaultView = 'uccello::modules.default.' . $viewName; |
|
110 | + $uccelloDefaultView = 'uccello::modules.default.'.$viewName; |
|
111 | 111 | |
112 | 112 | $viewToInclude = null; |
113 | 113 | if (view()->exists($appModuleView)) { |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | * @param boolean $absolute |
140 | 140 | * @return string |
141 | 141 | */ |
142 | - public function route($name, $domain = null, $module = null, $parameters = [], $absolute = true) : string |
|
142 | + public function route($name, $domain = null, $module = null, $parameters = [ ], $absolute = true) : string |
|
143 | 143 | { |
144 | 144 | if (is_a($domain, Domain::class)) { |
145 | 145 | $domain = $domain->slug; |
@@ -154,12 +154,12 @@ discard block |
||
154 | 154 | |
155 | 155 | // Add domain to route if we use multi domains and if the parameter is needed |
156 | 156 | if (!is_null($domain) && uccello()->useMultiDomains() && preg_match('`{domain}`', $routeUri)) { |
157 | - $parameters['domain'] = $domain; |
|
157 | + $parameters[ 'domain' ] = $domain; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | // Add module to route if the parameter is needed |
161 | 161 | if (!is_null($module) && preg_match('`{module}`', $routeUri)) { |
162 | - $parameters['module'] = $module; |
|
162 | + $parameters[ 'module' ] = $module; |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | return route($name, $parameters, $absolute); |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | if (is_numeric($nameOrId)) { |
189 | 189 | return Module::find($nameOrId); |
190 | 190 | } else { |
191 | - return Module::where('name', (string) $nameOrId)->first(); |
|
191 | + return Module::where('name', (string)$nameOrId)->first(); |
|
192 | 192 | } |
193 | 193 | } |
194 | 194 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | if (is_numeric($nameOrId)) { |
204 | 204 | return Uitype::find($nameOrId); |
205 | 205 | } else { |
206 | - return Uitype::where('name', (string) $nameOrId)->first(); |
|
206 | + return Uitype::where('name', (string)$nameOrId)->first(); |
|
207 | 207 | } |
208 | 208 | } |
209 | 209 | |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | if (is_numeric($nameOrId)) { |
219 | 219 | return Displaytype::find($nameOrId); |
220 | 220 | } else { |
221 | - return Displaytype::where('name', (string) $nameOrId)->first(); |
|
221 | + return Displaytype::where('name', (string)$nameOrId)->first(); |
|
222 | 222 | } |
223 | 223 | } |
224 | 224 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | if (is_numeric($nameOrId)) { |
234 | 234 | return Capability::find($nameOrId); |
235 | 235 | } else { |
236 | - return Capability::where('name', (string) $nameOrId)->first(); |
|
236 | + return Capability::where('name', (string)$nameOrId)->first(); |
|
237 | 237 | } |
238 | 238 | } |
239 | 239 | |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | $domain = Auth::user()->lastDomain ?? null; // On login page user is not authenticated |
258 | 258 | |
259 | 259 | if (!$domain) { |
260 | - $domain = $this->getRootDomains()[0]; |
|
260 | + $domain = $this->getRootDomains()[ 0 ]; |
|
261 | 261 | } |
262 | 262 | |
263 | 263 | return $domain; |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | */ |
272 | 272 | public function getDatatableColumns(Module $module): array |
273 | 273 | { |
274 | - $columns = []; |
|
274 | + $columns = [ ]; |
|
275 | 275 | |
276 | 276 | // Get default filter |
277 | 277 | $filter = Filter::where('module_id', $module->id) |
@@ -283,12 +283,12 @@ discard block |
||
283 | 283 | |
284 | 284 | foreach ($fields as $field) { |
285 | 285 | // If the field is not listable, continue |
286 | - if (!$field->isListable()){ |
|
286 | + if (!$field->isListable()) { |
|
287 | 287 | continue; |
288 | 288 | } |
289 | 289 | |
290 | 290 | // Add the field as a new column |
291 | - $columns[] = [ |
|
291 | + $columns[ ] = [ |
|
292 | 292 | 'name' => $field->name, |
293 | 293 | 'db_column' => $field->column, |
294 | 294 | 'uitype' => $field->uitype->name, |
@@ -118,7 +118,7 @@ |
||
118 | 118 | $viewToInclude = $packageModuleView; |
119 | 119 | } elseif (view()->exists($packageDefaultView)) { |
120 | 120 | $viewToInclude = $packageDefaultView; |
121 | - } elseif (view()->exists($uccelloModuleView)) { |
|
121 | + } elseif (view()->exists($uccelloModuleView)) { |
|
122 | 122 | $viewToInclude = $uccelloModuleView; |
123 | 123 | } elseif (view()->exists($uccelloDefaultView)) { |
124 | 124 | $viewToInclude = $uccelloDefaultView; |
@@ -36,13 +36,13 @@ |
||
36 | 36 | public function getFormOptions($record, Field $field, Module $module) : array |
37 | 37 | { |
38 | 38 | if (!is_object($field->data)) { |
39 | - return []; |
|
39 | + return [ ]; |
|
40 | 40 | } |
41 | 41 | |
42 | - $choices = []; |
|
42 | + $choices = [ ]; |
|
43 | 43 | if ($field->data->choices) { |
44 | 44 | foreach ($field->data->choices as $choice) { |
45 | - $choices[$choice] = uctrans($choice, $module); |
|
45 | + $choices[ $choice ] = uctrans($choice, $module); |
|
46 | 46 | } |
47 | 47 | } |
48 | 48 |
@@ -32,7 +32,7 @@ |
||
32 | 32 | { |
33 | 33 | $options = parent::getFormOptions($record, $field, $module); |
34 | 34 | |
35 | - $options['attr'] = ['class' => 'form-control datepicker']; |
|
35 | + $options[ 'attr' ] = [ 'class' => 'form-control datepicker' ]; |
|
36 | 36 | |
37 | 37 | return $options; |
38 | 38 | } |
@@ -42,7 +42,7 @@ |
||
42 | 42 | * @param \Uccello\Core\Models\Module|null $module |
43 | 43 | * @return string|null |
44 | 44 | */ |
45 | - public function getFormattedValueToSave(Request $request, Field $field, $value, $record=null, ?Domain $domain=null, ?Module $module=null) : ?string |
|
45 | + public function getFormattedValueToSave(Request $request, Field $field, $value, $record = null, ?Domain $domain = null, ?Module $module = null) : ?string |
|
46 | 46 | { |
47 | 47 | return Hash::make($value); |
48 | 48 | } |
@@ -41,7 +41,7 @@ |
||
41 | 41 | */ |
42 | 42 | public function getFormOptions($record, Field $field, Module $module) : array |
43 | 43 | { |
44 | - $options['attr'] = ['class' => 'form-control timepicker']; |
|
44 | + $options[ 'attr' ] = [ 'class' => 'form-control timepicker' ]; |
|
45 | 45 | |
46 | 46 | return $options; |
47 | 47 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | */ |
46 | 46 | public function getFormOptions($record, Field $field, Module $module) : array |
47 | 47 | { |
48 | - $options['attr'] = ['class' => 'form-control datetimepicker']; |
|
48 | + $options[ 'attr' ] = [ 'class' => 'form-control datetimepicker' ]; |
|
49 | 49 | |
50 | 50 | return $options; |
51 | 51 | } |
@@ -29,13 +29,13 @@ |
||
29 | 29 | public function getFormOptions($record, Field $field, Module $module) : array |
30 | 30 | { |
31 | 31 | if (!is_object($field->data)) { |
32 | - return []; |
|
32 | + return [ ]; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | $options = parent::getFormOptions($record, $field, $module); |
36 | 36 | |
37 | - $options['expanded'] = true; |
|
38 | - $options['multiple'] = $field->data->multiple ?? false; |
|
37 | + $options[ 'expanded' ] = true; |
|
38 | + $options[ 'multiple' ] = $field->data->multiple ?? false; |
|
39 | 39 | |
40 | 40 | return $options; |
41 | 41 | } |