We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -2,7 +2,7 @@ |
||
2 | 2 | <span> |
3 | 3 | <?php |
4 | 4 | $array = $entry->{$column['name']}; |
5 | - $suffix = isset($column['suffix'])?$column['suffix']:'items'; |
|
5 | + $suffix = isset($column['suffix']) ? $column['suffix'] : 'items'; |
|
6 | 6 | |
7 | 7 | // the value should be an array wether or not attribute casting is used |
8 | 8 | if (!is_array($array)) { |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace Backpack\CRUD\Tests\Unit\CrudPanel; |
4 | 4 | |
5 | -use Illuminate\Support\Facades\DB; |
|
6 | 5 | use Backpack\CRUD\Tests\Unit\Models\Article; |
6 | +use Illuminate\Support\Facades\DB; |
|
7 | 7 | |
8 | 8 | class CrudPanelTabsTest extends BaseDBCrudPanelTest |
9 | 9 | { |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | $button = $this->buttons()->firstWhere('name', $name); |
109 | 109 | |
110 | - if (! $button) { |
|
110 | + if (!$button) { |
|
111 | 111 | abort(500, 'CRUD Button "'.$name.'" not found. Please check the button exists before you modify it.'); |
112 | 112 | } |
113 | 113 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | */ |
129 | 129 | public function removeButton($name, $stack = null) |
130 | 130 | { |
131 | - $this->buttons = $this->buttons->reject(function ($button) use ($name, $stack) { |
|
131 | + $this->buttons = $this->buttons->reject(function($button) use ($name, $stack) { |
|
132 | 132 | return $stack == null ? $button->name == $name : ($button->stack == $stack) && ($button->name == $name); |
133 | 133 | }); |
134 | 134 | } |
@@ -140,14 +140,14 @@ discard block |
||
140 | 140 | |
141 | 141 | public function removeAllButtonsFromStack($stack) |
142 | 142 | { |
143 | - $this->buttons = $this->buttons->reject(function ($button) use ($stack) { |
|
143 | + $this->buttons = $this->buttons->reject(function($button) use ($stack) { |
|
144 | 144 | return $button->stack == $stack; |
145 | 145 | }); |
146 | 146 | } |
147 | 147 | |
148 | 148 | public function removeButtonFromStack($name, $stack) |
149 | 149 | { |
150 | - $this->buttons = $this->buttons->reject(function ($button) use ($name, $stack) { |
|
150 | + $this->buttons = $this->buttons->reject(function($button) use ($name, $stack) { |
|
151 | 151 | return $button->name == $name && $button->stack == $stack; |
152 | 152 | }); |
153 | 153 | } |
@@ -62,6 +62,9 @@ discard block |
||
62 | 62 | $this->addButton($stack, $name, 'model_function', $model_function_name, $position); |
63 | 63 | } |
64 | 64 | |
65 | + /** |
|
66 | + * @param string $view |
|
67 | + */ |
|
65 | 68 | public function addButtonFromView($stack, $name, $view, $position = false) |
66 | 69 | { |
67 | 70 | $view = 'vendor.backpack.crud.buttons.'.$view; |
@@ -98,7 +101,7 @@ discard block |
||
98 | 101 | * @param string $name The button name. |
99 | 102 | * @param array $modifications The attributes and their new values. |
100 | 103 | * |
101 | - * @return CrudButton The button that has suffered the changes, for daisychaining methods. |
|
104 | + * @return Collection The button that has suffered the changes, for daisychaining methods. |
|
102 | 105 | */ |
103 | 106 | public function modifyButton($name, $modifications = null) |
104 | 107 | { |
@@ -138,6 +141,9 @@ discard block |
||
138 | 141 | $this->buttons = collect([]); |
139 | 142 | } |
140 | 143 | |
144 | + /** |
|
145 | + * @param string $stack |
|
146 | + */ |
|
141 | 147 | public function removeAllButtonsFromStack($stack) |
142 | 148 | { |
143 | 149 | $this->buttons = $this->buttons->reject(function ($button) use ($stack) { |
@@ -160,6 +166,12 @@ discard block |
||
160 | 166 | public $type = 'view'; |
161 | 167 | public $content; |
162 | 168 | |
169 | + /** |
|
170 | + * @param string $stack |
|
171 | + * @param string $name |
|
172 | + * @param string $type |
|
173 | + * @param string $content |
|
174 | + */ |
|
163 | 175 | public function __construct($stack, $name, $type, $content) |
164 | 176 | { |
165 | 177 | $this->stack = $stack; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function tabsDisabled() |
37 | 37 | { |
38 | - return ! $this->tabsEnabled; |
|
38 | + return !$this->tabsEnabled; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | public function setTabsType($type) |
@@ -116,8 +116,8 @@ discard block |
||
116 | 116 | { |
117 | 117 | $all_fields = $this->getCurrentFields(); |
118 | 118 | |
119 | - $fields_without_a_tab = collect($all_fields)->filter(function ($value, $key) { |
|
120 | - return ! isset($value['tab']); |
|
119 | + $fields_without_a_tab = collect($all_fields)->filter(function($value, $key) { |
|
120 | + return !isset($value['tab']); |
|
121 | 121 | }); |
122 | 122 | |
123 | 123 | return $fields_without_a_tab; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | if ($this->tabExists($label)) { |
134 | 134 | $all_fields = $this->getCurrentFields(); |
135 | 135 | |
136 | - $fields_for_current_tab = collect($all_fields)->filter(function ($value, $key) use ($label) { |
|
136 | + $fields_for_current_tab = collect($all_fields)->filter(function($value, $key) use ($label) { |
|
137 | 137 | return isset($value['tab']) && $value['tab'] == $label; |
138 | 138 | }); |
139 | 139 | |
@@ -152,11 +152,11 @@ discard block |
||
152 | 152 | $fields = $this->getCurrentFields(); |
153 | 153 | |
154 | 154 | $fields_with_tabs = collect($fields) |
155 | - ->filter(function ($value, $key) { |
|
155 | + ->filter(function($value, $key) { |
|
156 | 156 | return isset($value['tab']); |
157 | 157 | }) |
158 | - ->each(function ($value, $key) use (&$tabs) { |
|
159 | - if (! in_array($value['tab'], $tabs)) { |
|
158 | + ->each(function($value, $key) use (&$tabs) { |
|
159 | + if (!in_array($value['tab'], $tabs)) { |
|
160 | 160 | $tabs[] = $value['tab']; |
161 | 161 | } |
162 | 162 | }); |
@@ -1,24 +1,24 @@ |
||
1 | 1 | {{-- select_from_array column --}} |
2 | 2 | <span> |
3 | 3 | <?php |
4 | - if ($entry->{$column['name']} !== null) { |
|
5 | - if (is_array($entry->{$column['name']})) { |
|
6 | - $array_of_values = []; |
|
4 | + if ($entry->{$column['name']} !== null) { |
|
5 | + if (is_array($entry->{$column['name']})) { |
|
6 | + $array_of_values = []; |
|
7 | 7 | |
8 | - foreach ($entry->{$column['name']} as $key => $value) { |
|
9 | - $array_of_values[] = $column['options'][$value]; |
|
10 | - } |
|
8 | + foreach ($entry->{$column['name']} as $key => $value) { |
|
9 | + $array_of_values[] = $column['options'][$value]; |
|
10 | + } |
|
11 | 11 | |
12 | - if (count($array_of_values) > 1) { |
|
13 | - echo implode(', ', $array_of_values); |
|
14 | - } else { |
|
15 | - echo $array_of_values; |
|
16 | - } |
|
17 | - } else { |
|
18 | - echo $column['options'][$entry->{$column['name']}]; |
|
19 | - } |
|
20 | - } else { |
|
21 | - echo "-"; |
|
22 | - } |
|
23 | - ?> |
|
12 | + if (count($array_of_values) > 1) { |
|
13 | + echo implode(', ', $array_of_values); |
|
14 | + } else { |
|
15 | + echo $array_of_values; |
|
16 | + } |
|
17 | + } else { |
|
18 | + echo $column['options'][$entry->{$column['name']}]; |
|
19 | + } |
|
20 | + } else { |
|
21 | + echo "-"; |
|
22 | + } |
|
23 | + ?> |
|
24 | 24 | </span> |
@@ -5,7 +5,7 @@ |
||
5 | 5 | |
6 | 6 | // if attribute casting is used, convert to JSON |
7 | 7 | if (is_array($value)) { |
8 | - $value = json_encode((object)$value); |
|
8 | + $value = json_encode((object) $value); |
|
9 | 9 | } elseif (is_object($value)) { |
10 | 10 | $value = json_encode($value); |
11 | 11 | } else { |
@@ -8,7 +8,7 @@ |
||
8 | 8 | <label>{!! $field['label'] !!}</label> |
9 | 9 | @include('crud::inc.field_translatable_icon') |
10 | 10 | |
11 | - <?php $entity_model = $crud->getRelationModel($field['entity'], - 1); ?> |
|
11 | + <?php $entity_model = $crud->getRelationModel($field['entity'], - 1); ?> |
|
12 | 12 | <select |
13 | 13 | name="{{ $field['name'] }}" |
14 | 14 | style="width: 100%" |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! function_exists('square_brackets_to_dots')) { |
|
3 | +if (!function_exists('square_brackets_to_dots')) { |
|
4 | 4 | /** |
5 | 5 | * Turns a string from bracket-type array to dot-notation array. |
6 | 6 | * Ex: array[0][property] turns into array.0.property. |