We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -5,7 +5,7 @@ |
||
5 | 5 | |
6 | 6 | <span> |
7 | 7 | <?php |
8 | - $suffix = isset($column['suffix'])?$column['suffix']:'items'; |
|
8 | + $suffix = isset($column['suffix']) ? $column['suffix'] : 'items'; |
|
9 | 9 | |
10 | 10 | // the value should be an array wether or not attribute casting is used |
11 | 11 | if (!is_array($array)) { |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | $button = $this->buttons()->firstWhere('name', $name); |
110 | 110 | |
111 | - if (! $button) { |
|
111 | + if (!$button) { |
|
112 | 112 | abort(500, 'CRUD Button "'.$name.'" not found. Please check the button exists before you modify it.'); |
113 | 113 | } |
114 | 114 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | */ |
130 | 130 | public function removeButton($name, $stack = null) |
131 | 131 | { |
132 | - $this->buttons = $this->buttons->reject(function ($button) use ($name, $stack) { |
|
132 | + $this->buttons = $this->buttons->reject(function($button) use ($name, $stack) { |
|
133 | 133 | return $stack == null ? $button->name == $name : ($button->stack == $stack) && ($button->name == $name); |
134 | 134 | }); |
135 | 135 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | */ |
141 | 141 | public function removeButtons($names, $stack = null) |
142 | 142 | { |
143 | - if (! empty($names)) { |
|
143 | + if (!empty($names)) { |
|
144 | 144 | foreach ($names as $name) { |
145 | 145 | $this->removeButton($name, $stack); |
146 | 146 | } |
@@ -154,14 +154,14 @@ discard block |
||
154 | 154 | |
155 | 155 | public function removeAllButtonsFromStack($stack) |
156 | 156 | { |
157 | - $this->buttons = $this->buttons->reject(function ($button) use ($stack) { |
|
157 | + $this->buttons = $this->buttons->reject(function($button) use ($stack) { |
|
158 | 158 | return $button->stack == $stack; |
159 | 159 | }); |
160 | 160 | } |
161 | 161 | |
162 | 162 | public function removeButtonFromStack($name, $stack) |
163 | 163 | { |
164 | - $this->buttons = $this->buttons->reject(function ($button) use ($name, $stack) { |
|
164 | + $this->buttons = $this->buttons->reject(function($button) use ($name, $stack) { |
|
165 | 165 | return $button->name == $name && $button->stack == $stack; |
166 | 166 | }); |
167 | 167 | } |
@@ -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 = 'crud::buttons.'.$view; |
@@ -139,6 +142,9 @@ discard block |
||
139 | 142 | $this->buttons = collect([]); |
140 | 143 | } |
141 | 144 | |
145 | + /** |
|
146 | + * @param string $stack |
|
147 | + */ |
|
142 | 148 | public function removeAllButtonsFromStack($stack) |
143 | 149 | { |
144 | 150 | $this->buttons = $this->buttons->reject(function ($button) use ($stack) { |
@@ -161,6 +167,12 @@ discard block |
||
161 | 167 | public $type = 'view'; |
162 | 168 | public $content; |
163 | 169 | |
170 | + /** |
|
171 | + * @param string $stack |
|
172 | + * @param string $name |
|
173 | + * @param string $type |
|
174 | + * @param string $content |
|
175 | + */ |
|
164 | 176 | public function __construct($stack, $name, $type, $content) |
165 | 177 | { |
166 | 178 | $this->stack = $stack; |
@@ -1,6 +1,6 @@ discard block |
||
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. |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | } |
18 | 18 | } |
19 | 19 | |
20 | -if (! function_exists('is_countable')) { |
|
20 | +if (!function_exists('is_countable')) { |
|
21 | 21 | /** |
22 | 22 | * We need this because is_countable was only introduced in PHP 7.3, |
23 | 23 | * and in PHP 7.2 you should check if count() argument is really countable. |
@@ -5,24 +5,24 @@ |
||
5 | 5 | |
6 | 6 | <span> |
7 | 7 | <?php |
8 | - if ($values !== null) { |
|
9 | - if (is_array($values)) { |
|
10 | - $array_of_values = []; |
|
8 | + if ($values !== null) { |
|
9 | + if (is_array($values)) { |
|
10 | + $array_of_values = []; |
|
11 | 11 | |
12 | - foreach ($values as $key => $value) { |
|
13 | - $array_of_values[] = $column['options'][$value]; |
|
14 | - } |
|
12 | + foreach ($values as $key => $value) { |
|
13 | + $array_of_values[] = $column['options'][$value]; |
|
14 | + } |
|
15 | 15 | |
16 | - if (count($array_of_values) > 1) { |
|
17 | - echo implode(', ', $array_of_values); |
|
18 | - } else { |
|
19 | - echo $array_of_values; |
|
20 | - } |
|
21 | - } else { |
|
22 | - echo $column['options'][$values]; |
|
23 | - } |
|
24 | - } else { |
|
25 | - echo "-"; |
|
26 | - } |
|
27 | - ?> |
|
16 | + if (count($array_of_values) > 1) { |
|
17 | + echo implode(', ', $array_of_values); |
|
18 | + } else { |
|
19 | + echo $array_of_values; |
|
20 | + } |
|
21 | + } else { |
|
22 | + echo $column['options'][$values]; |
|
23 | + } |
|
24 | + } else { |
|
25 | + echo "-"; |
|
26 | + } |
|
27 | + ?> |
|
28 | 28 | </span> |
29 | 29 | \ No newline at end of file |
@@ -68,10 +68,10 @@ |
||
68 | 68 | <ol class="sortable mt-0"> |
69 | 69 | <?php |
70 | 70 | $all_entries = collect($entries->all())->sortBy('lft')->keyBy($crud->getModel()->getKeyName()); |
71 | - $root_entries = $all_entries->filter(function ($item) { |
|
71 | + $root_entries = $all_entries->filter(function($item) { |
|
72 | 72 | return $item->parent_id == 0; |
73 | 73 | }); |
74 | - foreach ($root_entries as $key => $entry){ |
|
74 | + foreach ($root_entries as $key => $entry) { |
|
75 | 75 | $root_entries[$key] = tree_element($entry, $key, $all_entries, $crud); |
76 | 76 | } |
77 | 77 | ?> |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace Backpack\CRUD\app\Http\Controllers\Operations; |
4 | 4 | |
5 | -use Illuminate\Support\Facades\Route; |
|
6 | 5 | use Illuminate\Http\Request as StoreRequest; |
6 | +use Illuminate\Support\Facades\Route; |
|
7 | 7 | |
8 | 8 | trait CreateOperation |
9 | 9 | { |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace Backpack\CRUD\app\Http\Controllers\Operations; |
4 | 4 | |
5 | -use Illuminate\Support\Facades\Route; |
|
6 | 5 | use Illuminate\Http\Request as UpdateRequest; |
6 | +use Illuminate\Support\Facades\Route; |
|
7 | 7 | |
8 | 8 | trait UpdateOperation |
9 | 9 | { |
@@ -9,7 +9,6 @@ |
||
9 | 9 | /** |
10 | 10 | * Define which routes are needed for this operation. |
11 | 11 | * |
12 | - * @param string $name Name of the current entity (singular). Used as first URL segment. |
|
13 | 12 | * @param string $routeName Prefix of the route name. |
14 | 13 | * @param string $controller Name of the current CrudController. |
15 | 14 | */ |
@@ -24,7 +24,6 @@ |
||
24 | 24 | /** |
25 | 25 | * Create duplicates of multiple entries in the datatabase. |
26 | 26 | * |
27 | - * @param int $id |
|
28 | 27 | * |
29 | 28 | * @return Response |
30 | 29 | */ |
@@ -26,7 +26,7 @@ |
||
26 | 26 | * |
27 | 27 | * @param int $id |
28 | 28 | * |
29 | - * @return Response |
|
29 | + * @return string |
|
30 | 30 | */ |
31 | 31 | public function clone($id) |
32 | 32 | { |