We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -79,7 +79,7 @@ |
||
79 | 79 | { |
80 | 80 | $stub = str_replace('Backpack\CRUD\app\Models;', $this->laravel->getNamespace().'Models;', $stub); |
81 | 81 | |
82 | - if (! $this->files->exists($this->laravel['path'].'/User.php') && $this->files->exists($this->laravel['path'].'/Models/User.php')) { |
|
82 | + if (!$this->files->exists($this->laravel['path'].'/User.php') && $this->files->exists($this->laravel['path'].'/Models/User.php')) { |
|
83 | 83 | $stub = str_replace($this->laravel->getNamespace().'User', $this->laravel->getNamespace().'Models\User', $stub); |
84 | 84 | } |
85 | 85 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | /** |
34 | 34 | * Execute the console command. |
35 | 35 | * |
36 | - * @return bool|null |
|
36 | + * @return false|null |
|
37 | 37 | */ |
38 | 38 | public function handle() |
39 | 39 | { |
@@ -71,9 +71,8 @@ discard block |
||
71 | 71 | * Replace the User model, if it was moved to App\Models\User. |
72 | 72 | * |
73 | 73 | * @param string $stub |
74 | - * @param string $name |
|
75 | 74 | * |
76 | - * @return $this |
|
75 | + * @return string |
|
77 | 76 | */ |
78 | 77 | protected function makeReplacements(&$stub) |
79 | 78 | { |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | */ |
25 | 25 | public function getAttributeValue($key) |
26 | 26 | { |
27 | - if (! $this->isTranslatableAttribute($key)) { |
|
27 | + if (!$this->isTranslatableAttribute($key)) { |
|
28 | 28 | return parent::getAttributeValue($key); |
29 | 29 | } |
30 | 30 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function update(array $attributes = [], array $options = []) |
74 | 74 | { |
75 | - if (! $this->exists) { |
|
75 | + if (!$this->exists) { |
|
76 | 76 | return false; |
77 | 77 | } |
78 | 78 |
@@ -48,7 +48,7 @@ |
||
48 | 48 | $separator = $config['separator']; |
49 | 49 | $attribute = $attribute.'->'.$this->getLocale(); |
50 | 50 | |
51 | - return $query->where(function (Builder $q) use ($attribute, $slug, $separator) { |
|
51 | + return $query->where(function(Builder $q) use ($attribute, $slug, $separator) { |
|
52 | 52 | $q->where($attribute, '=', $slug) |
53 | 53 | ->orWhere($attribute, 'LIKE', $slug.$separator.'%') |
54 | 54 | // Fixes issues with Json data types in MySQL where data is sourrounded by " |
@@ -2,9 +2,9 @@ |
||
2 | 2 | |
3 | 3 | namespace Backpack\CRUD\app\Models\Traits\SpatieTranslatable; |
4 | 4 | |
5 | -use Illuminate\Database\Eloquent\Model; |
|
6 | -use Illuminate\Database\Eloquent\Builder; |
|
7 | 5 | use Cviebrock\EloquentSluggable\Sluggable as OriginalSluggable; |
6 | +use Illuminate\Database\Eloquent\Builder; |
|
7 | +use Illuminate\Database\Eloquent\Model; |
|
8 | 8 | |
9 | 9 | trait Sluggable |
10 | 10 | { |
@@ -38,7 +38,6 @@ |
||
38 | 38 | * Query scope for finding "similar" slugs, used to determine uniqueness. |
39 | 39 | * |
40 | 40 | * @param \Illuminate\Database\Eloquent\Builder $query |
41 | - * @param \Illuminate\Database\Eloquent\Model $model |
|
42 | 41 | * @param string $attribute |
43 | 42 | * @param array $config |
44 | 43 | * @param string $slug |
@@ -49,7 +49,7 @@ |
||
49 | 49 | */ |
50 | 50 | protected function makeSlugUnique(string $slug, array $config, string $attribute): string |
51 | 51 | { |
52 | - if (! $config['unique']) { |
|
52 | + if (!$config['unique']) { |
|
53 | 53 | return $slug; |
54 | 54 | } |
55 | 55 |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | $button = $this->buttons()->firstWhere('name', $name); |
94 | 94 | |
95 | - if (! $button) { |
|
95 | + if (!$button) { |
|
96 | 96 | abort(500, 'CRUD Button "'.$name.'" not found. Please check the button exists before you modify it.'); |
97 | 97 | } |
98 | 98 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function removeButton($name, $stack = null) |
115 | 115 | { |
116 | - $this->setOperationSetting('buttons', $this->buttons()->reject(function ($button) use ($name, $stack) { |
|
116 | + $this->setOperationSetting('buttons', $this->buttons()->reject(function($button) use ($name, $stack) { |
|
117 | 117 | return $stack == null ? $button->name == $name : ($button->stack == $stack) && ($button->name == $name); |
118 | 118 | })); |
119 | 119 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | */ |
125 | 125 | public function removeButtons($names, $stack = null) |
126 | 126 | { |
127 | - if (! empty($names)) { |
|
127 | + if (!empty($names)) { |
|
128 | 128 | foreach ($names as $name) { |
129 | 129 | $this->removeButton($name, $stack); |
130 | 130 | } |
@@ -138,14 +138,14 @@ discard block |
||
138 | 138 | |
139 | 139 | public function removeAllButtonsFromStack($stack) |
140 | 140 | { |
141 | - $this->setOperationSetting('buttons', $this->buttons()->reject(function ($button) use ($stack) { |
|
141 | + $this->setOperationSetting('buttons', $this->buttons()->reject(function($button) use ($stack) { |
|
142 | 142 | return $button->stack == $stack; |
143 | 143 | })); |
144 | 144 | } |
145 | 145 | |
146 | 146 | public function removeButtonFromStack($name, $stack) |
147 | 147 | { |
148 | - $this->setOperationSetting('buttons', $this->buttons()->reject(function ($button) use ($name, $stack) { |
|
148 | + $this->setOperationSetting('buttons', $this->buttons()->reject(function($button) use ($name, $stack) { |
|
149 | 149 | return $button->name == $name && $button->stack == $stack; |
150 | 150 | })); |
151 | 151 | } |
@@ -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; |
@@ -119,7 +122,7 @@ discard block |
||
119 | 122 | } |
120 | 123 | |
121 | 124 | /** |
122 | - * @param array $names Button names |
|
125 | + * @param string[] $names Button names |
|
123 | 126 | * @param string|null $stack Optional stack name. |
124 | 127 | */ |
125 | 128 | public function removeButtons($names, $stack = null) |
@@ -136,6 +139,9 @@ discard block |
||
136 | 139 | $this->setOperationSetting('buttons', collect()); |
137 | 140 | } |
138 | 141 | |
142 | + /** |
|
143 | + * @param string $stack |
|
144 | + */ |
|
139 | 145 | public function removeAllButtonsFromStack($stack) |
140 | 146 | { |
141 | 147 | $this->setOperationSetting('buttons', $this->buttons()->reject(function ($button) use ($stack) { |
@@ -158,6 +164,12 @@ discard block |
||
158 | 164 | public $type = 'view'; |
159 | 165 | public $content; |
160 | 166 | |
167 | + /** |
|
168 | + * @param string $stack |
|
169 | + * @param string $name |
|
170 | + * @param string $type |
|
171 | + * @param string $content |
|
172 | + */ |
|
161 | 173 | public function __construct($stack, $name, $type, $content) |
162 | 174 | { |
163 | 175 | $this->stack = $stack; |
@@ -21,7 +21,7 @@ |
||
21 | 21 | $revisionDate = date('Y-m-d', strtotime((string) $history->created_at)); |
22 | 22 | |
23 | 23 | // Be sure to instantiate the initial grouping array |
24 | - if (! array_key_exists($revisionDate, $revisions)) { |
|
24 | + if (!array_key_exists($revisionDate, $revisions)) { |
|
25 | 25 | $revisions[$revisionDate] = []; |
26 | 26 | } |
27 | 27 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function getTitle($action = false) |
23 | 23 | { |
24 | - if (! $action) { |
|
24 | + if (!$action) { |
|
25 | 25 | $action = $this->getActionMethod(); |
26 | 26 | } |
27 | 27 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function setTitle($string, $action = false) |
40 | 40 | { |
41 | - if (! $action) { |
|
41 | + if (!$action) { |
|
42 | 42 | $action = $this->getActionMethod(); |
43 | 43 | } |
44 | 44 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function getHeading($action = false) |
60 | 60 | { |
61 | - if (! $action) { |
|
61 | + if (!$action) { |
|
62 | 62 | $action = $this->getActionMethod(); |
63 | 63 | } |
64 | 64 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function setHeading($string, $action = false) |
77 | 77 | { |
78 | - if (! $action) { |
|
78 | + if (!$action) { |
|
79 | 79 | $action = $this->getActionMethod(); |
80 | 80 | } |
81 | 81 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function getSubheading($action = false) |
97 | 97 | { |
98 | - if (! $action) { |
|
98 | + if (!$action) { |
|
99 | 99 | $action = $this->getActionMethod(); |
100 | 100 | } |
101 | 101 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function setSubheading($string, $action = false) |
114 | 114 | { |
115 | - if (! $action) { |
|
115 | + if (!$action) { |
|
116 | 116 | $action = $this->getActionMethod(); |
117 | 117 | } |
118 | 118 |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | { |
39 | 39 | $id = $this->getCurrentEntryId(); |
40 | 40 | |
41 | - if (! $id) { |
|
41 | + if (!$id) { |
|
42 | 42 | return false; |
43 | 43 | } |
44 | 44 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function getEntry($id) |
56 | 56 | { |
57 | - if (! $this->entry) { |
|
57 | + if (!$this->entry) { |
|
58 | 58 | $this->entry = $this->model->findOrFail($id); |
59 | 59 | $this->entry = $this->entry->withFakes(); |
60 | 60 | } |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | { |
200 | 200 | // If the default Page Length isn't in the menu's values, Add it the beginnin and resort all to show a croissant list. |
201 | 201 | // assume both arrays are the same length. |
202 | - if (! in_array($this->getDefaultPageLength(), $this->getOperationSetting('pageLengthMenu')[0])) { |
|
202 | + if (!in_array($this->getDefaultPageLength(), $this->getOperationSetting('pageLengthMenu')[0])) { |
|
203 | 203 | // Loop through 2 arrays of prop. page_length_menu |
204 | 204 | foreach ($this->getOperationSetting('pageLengthMenu') as $key => &$page_length_choices) { |
205 | 205 | // This is a condition that should be always true. |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | public function getPageLengthMenu() |
231 | 231 | { |
232 | 232 | // if already set, use that |
233 | - if (! $this->getOperationSetting('pageLengthMenu')) { |
|
233 | + if (!$this->getOperationSetting('pageLengthMenu')) { |
|
234 | 234 | // try to get the menu settings from the config file |
235 | 235 | $this->setOperationSetting('pageLengthMenu', config('backpack.crud.page_length_menu') ?? [[10, 25, 50, 100, -1], [10, 25, 50, 100, 'backpack::crud.all']]); |
236 | 236 |
@@ -175,6 +175,7 @@ |
||
175 | 175 | |
176 | 176 | /** |
177 | 177 | * Set the number of rows that should be show on the list view. |
178 | + * @param integer $value |
|
178 | 179 | */ |
179 | 180 | public function setDefaultPageLength($value) |
180 | 181 | { |
@@ -24,11 +24,11 @@ discard block |
||
24 | 24 | |
25 | 25 | $saveOptions = collect($permissions) |
26 | 26 | // Restrict list to allowed actions. |
27 | - ->filter(function ($action, $permission) { |
|
27 | + ->filter(function($action, $permission) { |
|
28 | 28 | return $this->hasAccess($permission); |
29 | 29 | }) |
30 | 30 | // Generate list of possible actions. |
31 | - ->mapWithKeys(function ($action, $permission) { |
|
31 | + ->mapWithKeys(function($action, $permission) { |
|
32 | 32 | return [$action => $this->getSaveActionButtonName($action)]; |
33 | 33 | }) |
34 | 34 | ->all(); |
@@ -63,8 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function setSaveAction($forceSaveAction = null) |
65 | 65 | { |
66 | - $saveAction = $forceSaveAction ?: |
|
67 | - \Request::input('save_action', config('backpack.crud.default_save_action', 'save_and_back')); |
|
66 | + $saveAction = $forceSaveAction ?: \Request::input('save_action', config('backpack.crud.default_save_action', 'save_and_back')); |
|
68 | 67 | |
69 | 68 | if (config('backpack.crud.show_save_action_change', true) && |
70 | 69 | session('save_action', 'save_and_back') !== $saveAction) { |