@@ -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 |
@@ -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 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * @param \Uccello\Core\Models\Module|null $module |
51 | 51 | * @return string|null |
52 | 52 | */ |
53 | - public function getFormattedValueToSave(Request $request, Field $field, $value, $record=null, ?Domain $domain=null, ?Module $module=null) : ?string |
|
53 | + public function getFormattedValueToSave(Request $request, Field $field, $value, $record = null, ?Domain $domain = null, ?Module $module = null) : ?string |
|
54 | 54 | { |
55 | 55 | //TODO: Delete old file |
56 | 56 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | // Make directory path |
64 | 64 | $directoryPath = isset($fieldData->public) && $fieldData->public === true ? 'public/' : ''; // Public or Private |
65 | - $directoryPath .= isset($domain) ? $domain->slug . '/' : ''; // Domain |
|
65 | + $directoryPath .= isset($domain) ? $domain->slug.'/' : ''; // Domain |
|
66 | 66 | $directoryPath .= isset($fieldData->path) ? trim($fieldData->path, '/') : ''; // Custom directory |
67 | 67 | |
68 | 68 | // Save file |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | } |
73 | 73 | // Delete file |
74 | - elseif ($request->input('delete-' . $field->name)) { |
|
74 | + elseif ($request->input('delete-'.$field->name)) { |
|
75 | 75 | $value = null; |
76 | 76 | |
77 | 77 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $fieldData = $field->data; |
99 | 99 | |
100 | 100 | // If the file is defined and is public, get its url |
101 | - if ($value && isset($fieldData->public) && $fieldData->public === true ) { |
|
101 | + if ($value && isset($fieldData->public) && $fieldData->public === true) { |
|
102 | 102 | $value = Storage::url($value); |
103 | 103 | } |
104 | 104 |
@@ -39,10 +39,10 @@ discard block |
||
39 | 39 | public function getFormOptions($record, Field $field, Module $module) : array |
40 | 40 | { |
41 | 41 | if (!is_object($field->data)) { |
42 | - return []; |
|
42 | + return [ ]; |
|
43 | 43 | } |
44 | 44 | |
45 | - $options = []; |
|
45 | + $options = [ ]; |
|
46 | 46 | |
47 | 47 | if ($field->data->module) { |
48 | 48 | $options = [ |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | 'property' => $field->data->field ?? 'recordLabel', |
51 | 51 | 'empty_value' => uctrans('select_empty_value', $module), |
52 | 52 | 'selected' => $record->{$field->column} ?? null, |
53 | - 'query_builder' => function ($relatedRecord) use($record) { |
|
53 | + 'query_builder' => function($relatedRecord) use($record) { |
|
54 | 54 | // If related record class is the same as the record one, ignore the current record |
55 | 55 | if (get_class($relatedRecord) === get_class($record)) { |
56 | 56 | return $relatedRecord->where($relatedRecord->getKeyName(), '!=', $record->getKey()); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function getDefaultDatabaseColumn(Field $field) : string |
73 | 73 | { |
74 | - return $field->name . '_id'; |
|
74 | + return $field->name.'_id'; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -146,14 +146,14 @@ discard block |
||
146 | 146 | // Get all modules |
147 | 147 | $modules = Module::orderBy('name')->get(); |
148 | 148 | |
149 | - $choices = []; |
|
149 | + $choices = [ ]; |
|
150 | 150 | foreach ($modules as $_module) { |
151 | - $choices[] = $_module->name; |
|
151 | + $choices[ ] = $_module->name; |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | // Add module itself if necessary |
155 | 155 | if (!in_array($module->name, $choices)) { |
156 | - $choices[] = $module->name; |
|
156 | + $choices[ ] = $module->name; |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | // Sort |