We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -43,7 +43,7 @@ |
||
43 | 43 | ], |
44 | 44 | |
45 | 45 | // CSS files that are loaded in all pages, using Laravel's mix() helper |
46 | - 'mix_styles' => [ // file_path => manifest_directory_path |
|
46 | + 'mix_styles' => [// file_path => manifest_directory_path |
|
47 | 47 | // 'css/app.css' => '', |
48 | 48 | ], |
49 | 49 |
@@ -38,7 +38,7 @@ |
||
38 | 38 | private function sendUsageStats() |
39 | 39 | { |
40 | 40 | // only send usage stats in production |
41 | - if (! $this->runningInProduction()) { |
|
41 | + if (!$this->runningInProduction()) { |
|
42 | 42 | return; |
43 | 43 | } |
44 | 44 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * Check if the application is running in normal conditions |
9 | 9 | * (production env, not in console, not in unit tests). |
10 | 10 | * |
11 | - * @return void |
|
11 | + * @return boolean |
|
12 | 12 | */ |
13 | 13 | private function runningInProduction() |
14 | 14 | { |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @param string $url URL to point the request at. |
86 | 86 | * @param array $payload The data you want sent to the URL. |
87 | 87 | * |
88 | - * @return void |
|
88 | + * @return boolean |
|
89 | 89 | */ |
90 | 90 | private function makeCurlRequest($method, $url, $payload) |
91 | 91 | { |
@@ -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 | { |
@@ -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 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | { |
204 | 204 | // If the default Page Length isn't in the menu's values, Add it the beginnin and resort all to show a croissant list. |
205 | 205 | // assume both arrays are the same length. |
206 | - if (! in_array($this->getDefaultPageLength(), $this->getOperationSetting('pageLengthMenu')[0])) { |
|
206 | + if (!in_array($this->getDefaultPageLength(), $this->getOperationSetting('pageLengthMenu')[0])) { |
|
207 | 207 | // Loop through 2 arrays of prop. pageLengthMenu |
208 | 208 | foreach ($this->getOperationSetting('pageLengthMenu') as $key => &$page_length_choices) { |
209 | 209 | // This is a condition that should be always true. |
@@ -301,6 +301,9 @@ discard block |
||
301 | 301 | return $this->getShowView(); |
302 | 302 | } |
303 | 303 | |
304 | + /** |
|
305 | + * @param string $view |
|
306 | + */ |
|
304 | 307 | public function setPreviewView($view) |
305 | 308 | { |
306 | 309 | return $this->setShowView($view); |
@@ -311,6 +314,9 @@ discard block |
||
311 | 314 | return $this->getEditView(); |
312 | 315 | } |
313 | 316 | |
317 | + /** |
|
318 | + * @param string $view |
|
319 | + */ |
|
314 | 320 | public function setUpdateView($view) |
315 | 321 | { |
316 | 322 | return $this->setEditView($view); |
@@ -54,13 +54,13 @@ discard block |
||
54 | 54 | public function register() |
55 | 55 | { |
56 | 56 | // Bind the CrudPanel object to Laravel's service container |
57 | - $this->app->singleton('crud', function ($app) { |
|
57 | + $this->app->singleton('crud', function($app) { |
|
58 | 58 | return new \Backpack\CRUD\app\Library\CrudPanel\CrudPanel($app); |
59 | 59 | }); |
60 | 60 | |
61 | 61 | // load a macro for Route, |
62 | 62 | // helps developers load all routes for a CRUD resource in one line |
63 | - if (! Route::hasMacro('crud')) { |
|
63 | + if (!Route::hasMacro('crud')) { |
|
64 | 64 | $this->addRouteMacro(); |
65 | 65 | } |
66 | 66 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | // } |
82 | 82 | |
83 | 83 | // map the elfinder prefix |
84 | - if (! \Config::get('elfinder.route.prefix')) { |
|
84 | + if (!\Config::get('elfinder.route.prefix')) { |
|
85 | 85 | \Config::set('elfinder.route.prefix', \Config::get('backpack.base.route_prefix').'/elfinder'); |
86 | 86 | } |
87 | 87 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $middleware_key = config('backpack.base.middleware_key'); |
92 | 92 | $middleware_class = config('backpack.base.middleware_class'); |
93 | 93 | |
94 | - if (! is_array($middleware_class)) { |
|
94 | + if (!is_array($middleware_class)) { |
|
95 | 95 | $router->pushMiddlewareToGroup($middleware_key, $middleware_class); |
96 | 96 | |
97 | 97 | return; |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | */ |
196 | 196 | private function addRouteMacro() |
197 | 197 | { |
198 | - Route::macro('crud', function ($name, $controller) { |
|
198 | + Route::macro('crud', function($name, $controller) { |
|
199 | 199 | // put together the route name prefix, |
200 | 200 | // as passed to the Route::group() statements |
201 | 201 | $routeName = ''; |
@@ -17,7 +17,7 @@ |
||
17 | 17 | return; |
18 | 18 | } |
19 | 19 | |
20 | - if (! $this->validCode(config('backpack.base.license_code'))) { |
|
20 | + if (!$this->validCode(config('backpack.base.license_code'))) { |
|
21 | 21 | \Alert::add('warning', "<strong>You're using unlicensed software.</strong> Please ask your web developer to <a target='_blank' class='alert-link text-white' href='http://backpackforlaravel.com'>purchase a license code</a> to hide this message."); |
22 | 22 | } |
23 | 23 | } |
@@ -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 | */ |
@@ -36,11 +36,11 @@ discard block |
||
36 | 36 | $this->crud->set('reorder.enabled', true); |
37 | 37 | $this->crud->allowAccess('reorder'); |
38 | 38 | |
39 | - $this->crud->operation('reorder', function () { |
|
39 | + $this->crud->operation('reorder', function() { |
|
40 | 40 | $this->crud->loadDefaultOperationSettingsFromConfig(); |
41 | 41 | }); |
42 | 42 | |
43 | - $this->crud->operation('list', function () { |
|
43 | + $this->crud->operation('list', function() { |
|
44 | 44 | $this->crud->addButton('top', 'reorder', 'view', 'crud::buttons.reorder'); |
45 | 45 | }); |
46 | 46 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | { |
57 | 57 | $this->crud->hasAccessOrFail('reorder'); |
58 | 58 | |
59 | - if (! $this->crud->isReorderEnabled()) { |
|
59 | + if (!$this->crud->isReorderEnabled()) { |
|
60 | 60 | abort(403, 'Reorder is disabled.'); |
61 | 61 | } |
62 | 62 |
@@ -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; |
@@ -20,18 +20,18 @@ discard block |
||
20 | 20 | { |
21 | 21 | $newBtns = collect([]); |
22 | 22 | |
23 | - $this->buttons()->each(function ($btn) use ($stack, $newBtns) { |
|
23 | + $this->buttons()->each(function($btn) use ($stack, $newBtns) { |
|
24 | 24 | if ($btn->stack != $stack) { |
25 | 25 | $newBtns->push($btn); |
26 | 26 | } |
27 | 27 | }); |
28 | 28 | |
29 | - collect($buttons)->each(function ($btnKey) use ($newBtns) { |
|
30 | - $btnInstance = $this->buttons()->filter(function ($btn) use ($btnKey) { |
|
29 | + collect($buttons)->each(function($btnKey) use ($newBtns) { |
|
30 | + $btnInstance = $this->buttons()->filter(function($btn) use ($btnKey) { |
|
31 | 31 | return $btn->name == $btnKey; |
32 | 32 | })->first(); |
33 | 33 | |
34 | - if (! $btnInstance) { |
|
34 | + if (!$btnInstance) { |
|
35 | 35 | abort(500, 'Sorry, button cannot be found'); |
36 | 36 | } |
37 | 37 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | $button = $this->buttons()->firstWhere('name', $name); |
123 | 123 | |
124 | - if (! $button) { |
|
124 | + if (!$button) { |
|
125 | 125 | abort(500, 'CRUD Button "'.$name.'" not found. Please check the button exists before you modify it.'); |
126 | 126 | } |
127 | 127 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | */ |
143 | 143 | public function removeButton($name, $stack = null) |
144 | 144 | { |
145 | - $this->setOperationSetting('buttons', $this->buttons()->reject(function ($button) use ($name, $stack) { |
|
145 | + $this->setOperationSetting('buttons', $this->buttons()->reject(function($button) use ($name, $stack) { |
|
146 | 146 | return $stack == null ? $button->name == $name : ($button->stack == $stack) && ($button->name == $name); |
147 | 147 | })); |
148 | 148 | } |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | */ |
154 | 154 | public function removeButtons($names, $stack = null) |
155 | 155 | { |
156 | - if (! empty($names)) { |
|
156 | + if (!empty($names)) { |
|
157 | 157 | foreach ($names as $name) { |
158 | 158 | $this->removeButton($name, $stack); |
159 | 159 | } |
@@ -167,14 +167,14 @@ discard block |
||
167 | 167 | |
168 | 168 | public function removeAllButtonsFromStack($stack) |
169 | 169 | { |
170 | - $this->setOperationSetting('buttons', $this->buttons()->reject(function ($button) use ($stack) { |
|
170 | + $this->setOperationSetting('buttons', $this->buttons()->reject(function($button) use ($stack) { |
|
171 | 171 | return $button->stack == $stack; |
172 | 172 | })); |
173 | 173 | } |
174 | 174 | |
175 | 175 | public function removeButtonFromStack($name, $stack) |
176 | 176 | { |
177 | - $this->setOperationSetting('buttons', $this->buttons()->reject(function ($button) use ($name, $stack) { |
|
177 | + $this->setOperationSetting('buttons', $this->buttons()->reject(function($button) use ($name, $stack) { |
|
178 | 178 | return $button->name == $name && $button->stack == $stack; |
179 | 179 | })); |
180 | 180 | } |
@@ -19,7 +19,7 @@ |
||
19 | 19 | * |
20 | 20 | * TODO: should this delete items with relations to it too? |
21 | 21 | * |
22 | - * @return bool True if the item was deleted. |
|
22 | + * @return string True if the item was deleted. |
|
23 | 23 | */ |
24 | 24 | public function delete($id) |
25 | 25 | { |