We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -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 | { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @param array $data |
68 | 68 | * |
69 | - * @return User |
|
69 | + * @return \Illuminate\Contracts\Auth\Authenticatable |
|
70 | 70 | */ |
71 | 71 | protected function create(array $data) |
72 | 72 | { |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * |
103 | 103 | * @param \Illuminate\Http\Request $request |
104 | 104 | * |
105 | - * @return \Illuminate\Http\Response |
|
105 | + * @return \Illuminate\Http\RedirectResponse |
|
106 | 106 | */ |
107 | 107 | public function register(Request $request) |
108 | 108 | { |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | public function showRegistrationForm() |
89 | 89 | { |
90 | 90 | // if registration is closed, deny access |
91 | - if (! config('backpack.base.registration_open')) { |
|
91 | + if (!config('backpack.base.registration_open')) { |
|
92 | 92 | abort(403, trans('backpack::base.registration_closed')); |
93 | 93 | } |
94 | 94 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | public function register(Request $request) |
108 | 108 | { |
109 | 109 | // if registration is closed, deny access |
110 | - if (! config('backpack.base.registration_open')) { |
|
110 | + if (!config('backpack.base.registration_open')) { |
|
111 | 111 | abort(403, trans('backpack::base.registration_closed')); |
112 | 112 | } |
113 | 113 |
@@ -27,7 +27,6 @@ |
||
27 | 27 | /** |
28 | 28 | * Get the path the user should be redirected to after password reset. |
29 | 29 | * |
30 | - * @param \Illuminate\Http\Request $request |
|
31 | 30 | * |
32 | 31 | * @return string |
33 | 32 | */ |
@@ -47,7 +47,7 @@ |
||
47 | 47 | |
48 | 48 | $this->middleware("guest:$guard"); |
49 | 49 | |
50 | - if (! backpack_users_have_email()) { |
|
50 | + if (!backpack_users_have_email()) { |
|
51 | 51 | abort(501, trans('backpack::base.no_email_column')); |
52 | 52 | } |
53 | 53 |
@@ -29,7 +29,7 @@ |
||
29 | 29 | /** |
30 | 30 | * Answer to unauthorized access request. |
31 | 31 | * |
32 | - * @param [type] $request [description] |
|
32 | + * @param \Illuminate\Http\Request $request [description] |
|
33 | 33 | * |
34 | 34 | * @return [type] [description] |
35 | 35 | */ |
@@ -56,7 +56,7 @@ |
||
56 | 56 | return $this->respondToUnauthorizedRequest($request); |
57 | 57 | } |
58 | 58 | |
59 | - if (! $this->checkIfUserIsAdmin(backpack_user())) { |
|
59 | + if (!$this->checkIfUserIsAdmin(backpack_user())) { |
|
60 | 60 | return $this->respondToUnauthorizedRequest($request); |
61 | 61 | } |
62 | 62 |
@@ -12,6 +12,9 @@ |
||
12 | 12 | return $this->getOperationSetting('autoFocusOnFirstField'); |
13 | 13 | } |
14 | 14 | |
15 | + /** |
|
16 | + * @param boolean $value |
|
17 | + */ |
|
15 | 18 | public function setAutoFocusOnFirstField($value) |
16 | 19 | { |
17 | 20 | return $this->setOperationSetting('autoFocusOnFirstField', (bool) $value); |
@@ -159,7 +159,7 @@ |
||
159 | 159 | * @param \Illuminate\Database\Eloquent\Model $item The current CRUD model. |
160 | 160 | * @param array $formattedData The form data. |
161 | 161 | * |
162 | - * @return bool|null |
|
162 | + * @return false|null |
|
163 | 163 | */ |
164 | 164 | private function createRelationsForItem($item, $formattedData) |
165 | 165 | { |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | { |
82 | 82 | $all_relation_fields = $this->getRelationFields(); |
83 | 83 | |
84 | - return array_where($all_relation_fields, function ($value, $key) { |
|
84 | + return array_where($all_relation_fields, function($value, $key) { |
|
85 | 85 | return isset($value['pivot']) && $value['pivot']; |
86 | 86 | }); |
87 | 87 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | */ |
157 | 157 | private function createRelationsForItem($item, $formattedData) |
158 | 158 | { |
159 | - if (! isset($formattedData['relations'])) { |
|
159 | + if (!isset($formattedData['relations'])) { |
|
160 | 160 | return false; |
161 | 161 | } |
162 | 162 | |
@@ -213,11 +213,11 @@ discard block |
||
213 | 213 | $key = implode('.relations.', explode('.', $relationField['entity'])); |
214 | 214 | $fieldData = array_get($relationData, 'relations.'.$key, []); |
215 | 215 | |
216 | - if (! array_key_exists('model', $fieldData)) { |
|
216 | + if (!array_key_exists('model', $fieldData)) { |
|
217 | 217 | $fieldData['model'] = $relationField['model']; |
218 | 218 | } |
219 | 219 | |
220 | - if (! array_key_exists('parent', $fieldData)) { |
|
220 | + if (!array_key_exists('parent', $fieldData)) { |
|
221 | 221 | $fieldData['parent'] = $this->getRelationModel($relationField['entity'], -1); |
222 | 222 | } |
223 | 223 |
@@ -10,8 +10,6 @@ |
||
10 | 10 | * plus the '_token' and 'redirect_after_save' variables. |
11 | 11 | * |
12 | 12 | * @param array $requestInput The request input. |
13 | - * @param string $form The CRUD form. Can be 'create' or 'update' . Default is 'create'. |
|
14 | - * @param int|bool $id The CRUD entry id in the case of the 'update' form. |
|
15 | 13 | * |
16 | 14 | * @see \Illuminate\Http\Request::all() For an example on how to get the request input. |
17 | 15 | * |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $fakeFieldKey = isset($field['store_in']) ? $field['store_in'] : 'extras'; |
33 | 33 | $this->addCompactedField($requestInput, $fieldName, $fakeFieldKey); |
34 | 34 | |
35 | - if (! in_array($fakeFieldKey, $compactedFakeFields)) { |
|
35 | + if (!in_array($fakeFieldKey, $compactedFakeFields)) { |
|
36 | 36 | $compactedFakeFields[] = $fakeFieldKey; |
37 | 37 | } |
38 | 38 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | // json_encode all fake_value columns if applicable in the database, so they can be properly stored and interpreted |
43 | 43 | foreach ($compactedFakeFields as $value) { |
44 | - if (! (property_exists($this->model, 'translatable') && in_array($value, $this->model->getTranslatableAttributes(), true)) && $this->model->shouldEncodeFake($value)) { |
|
44 | + if (!(property_exists($this->model, 'translatable') && in_array($value, $this->model->getTranslatableAttributes(), true)) && $this->model->shouldEncodeFake($value)) { |
|
45 | 45 | $requestInput[$value] = json_encode($requestInput[$value]); |
46 | 46 | } |
47 | 47 | } |
@@ -35,6 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | /** |
37 | 37 | * Apply the search logic for each CRUD column. |
38 | + * @param string $searchTerm |
|
38 | 39 | */ |
39 | 40 | public function applySearchLogicForColumn($query, $column, $searchTerm) |
40 | 41 | { |
@@ -230,7 +231,7 @@ discard block |
||
230 | 231 | * |
231 | 232 | * @param string $view |
232 | 233 | * @param array $column |
233 | - * @param object $entry |
|
234 | + * @param \Illuminate\Database\Eloquent\Model $entry |
|
234 | 235 | * @param bool|int $rowNumber The number shown to the user as row number (index) |
235 | 236 | * |
236 | 237 | * @return string |
@@ -210,10 +210,10 @@ |
||
210 | 210 | // add the details_row button to the first column |
211 | 211 | if ($this->getOperationSetting('detailsRow')) { |
212 | 212 | $details_row_button = \View::make('crud::columns.details_row_button') |
213 | - ->with('crud', $this) |
|
214 | - ->with('entry', $entry) |
|
215 | - ->with('row_number', $rowNumber) |
|
216 | - ->render(); |
|
213 | + ->with('crud', $this) |
|
214 | + ->with('entry', $entry) |
|
215 | + ->with('row_number', $rowNumber) |
|
216 | + ->render(); |
|
217 | 217 | $row_items[0] = $details_row_button.$row_items[0]; |
218 | 218 | } |
219 | 219 |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | */ |
23 | 23 | public function applySearchTerm($searchTerm) |
24 | 24 | { |
25 | - return $this->query->where(function ($query) use ($searchTerm) { |
|
25 | + return $this->query->where(function($query) use ($searchTerm) { |
|
26 | 26 | foreach ($this->columns() as $column) { |
27 | - if (! isset($column['type'])) { |
|
27 | + if (!isset($column['type'])) { |
|
28 | 28 | abort(400, 'Missing column type when trying to apply search term.'); |
29 | 29 | } |
30 | 30 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | case 'select': |
84 | 84 | case 'select_multiple': |
85 | - $query->orWhereHas($column['entity'], function ($q) use ($column, $searchTerm) { |
|
85 | + $query->orWhereHas($column['entity'], function($q) use ($column, $searchTerm) { |
|
86 | 86 | $q->where($column['attribute'], 'like', '%'.$searchTerm.'%'); |
87 | 87 | }); |
88 | 88 | break; |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | */ |
275 | 275 | private function renderCellView($view, $column, $entry, $rowNumber = false) |
276 | 276 | { |
277 | - if (! view()->exists($view)) { |
|
277 | + if (!view()->exists($view)) { |
|
278 | 278 | $view = 'crud::columns.text'; // fallback to text column |
279 | 279 | } |
280 | 280 |
@@ -35,6 +35,9 @@ |
||
35 | 35 | return ! $this->tabsEnabled(); |
36 | 36 | } |
37 | 37 | |
38 | + /** |
|
39 | + * @param string $type |
|
40 | + */ |
|
38 | 41 | public function setTabsType($type) |
39 | 42 | { |
40 | 43 | $this->enableTabs(); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function tabsDisabled() |
34 | 34 | { |
35 | - return ! $this->tabsEnabled(); |
|
35 | + return !$this->tabsEnabled(); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | public function setTabsType($type) |
@@ -114,8 +114,8 @@ discard block |
||
114 | 114 | { |
115 | 115 | $all_fields = $this->getCurrentFields(); |
116 | 116 | |
117 | - $fields_without_a_tab = collect($all_fields)->filter(function ($value, $key) { |
|
118 | - return ! isset($value['tab']); |
|
117 | + $fields_without_a_tab = collect($all_fields)->filter(function($value, $key) { |
|
118 | + return !isset($value['tab']); |
|
119 | 119 | }); |
120 | 120 | |
121 | 121 | return $fields_without_a_tab; |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | if ($this->tabExists($label)) { |
132 | 132 | $all_fields = $this->getCurrentFields(); |
133 | 133 | |
134 | - $fields_for_current_tab = collect($all_fields)->filter(function ($value, $key) use ($label) { |
|
134 | + $fields_for_current_tab = collect($all_fields)->filter(function($value, $key) use ($label) { |
|
135 | 135 | return isset($value['tab']) && $value['tab'] == $label; |
136 | 136 | }); |
137 | 137 | |
@@ -150,11 +150,11 @@ discard block |
||
150 | 150 | $fields = $this->getCurrentFields(); |
151 | 151 | |
152 | 152 | $fields_with_tabs = collect($fields) |
153 | - ->filter(function ($value, $key) { |
|
153 | + ->filter(function($value, $key) { |
|
154 | 154 | return isset($value['tab']); |
155 | 155 | }) |
156 | - ->each(function ($value, $key) use (&$tabs) { |
|
157 | - if (! in_array($value['tab'], $tabs)) { |
|
156 | + ->each(function($value, $key) use (&$tabs) { |
|
157 | + if (!in_array($value['tab'], $tabs)) { |
|
158 | 158 | $tabs[] = $value['tab']; |
159 | 159 | } |
160 | 160 | }); |