We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -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 | }); |
@@ -69,7 +69,7 @@ |
||
69 | 69 | * |
70 | 70 | * @param array $columns - the database columns that contain the JSONs |
71 | 71 | * |
72 | - * @return Model |
|
72 | + * @return CrudTrait |
|
73 | 73 | */ |
74 | 74 | public function withFakes($columns = []) |
75 | 75 | { |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | //check if column exists in database |
73 | 73 | $conn->getDoctrineColumn($table, $column_name); |
74 | 74 | |
75 | - return ! $conn->getDoctrineColumn($table, $column_name)->getNotnull(); |
|
75 | + return !$conn->getDoctrineColumn($table, $column_name)->getNotnull(); |
|
76 | 76 | } catch (Exception $e) { |
77 | 77 | return true; |
78 | 78 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | public function addFakes($columns = ['extras']) |
93 | 93 | { |
94 | 94 | foreach ($columns as $key => $column) { |
95 | - if (! isset($this->attributes[$column])) { |
|
95 | + if (!isset($this->attributes[$column])) { |
|
96 | 96 | continue; |
97 | 97 | } |
98 | 98 | |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | */ |
142 | 142 | public function shouldDecodeFake($column) |
143 | 143 | { |
144 | - return ! in_array($column, array_keys($this->casts)); |
|
144 | + return !in_array($column, array_keys($this->casts)); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | */ |
154 | 154 | public function shouldEncodeFake($column) |
155 | 155 | { |
156 | - return ! in_array($column, array_keys($this->casts)); |
|
156 | + return !in_array($column, array_keys($this->casts)); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | /* |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | public function uploadMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path) |
228 | 228 | { |
229 | 229 | $request = \Request::instance(); |
230 | - if (! is_array($this->{$attribute_name})) { |
|
230 | + if (!is_array($this->{$attribute_name})) { |
|
231 | 231 | $attribute_value = json_decode($this->{$attribute_name}, true) ?? []; |
232 | 232 | } else { |
233 | 233 | $attribute_value = $this->{$attribute_name}; |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | if ($files_to_clear) { |
240 | 240 | foreach ($files_to_clear as $key => $filename) { |
241 | 241 | \Storage::disk($disk)->delete($filename); |
242 | - $attribute_value = array_where($attribute_value, function ($value, $key) use ($filename) { |
|
242 | + $attribute_value = array_where($attribute_value, function($value, $key) use ($filename) { |
|
243 | 243 | return $value != $filename; |
244 | 244 | }); |
245 | 245 | } |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * Appends the configured backpack prefix and returns |
6 | 6 | * the URL using the standard Laravel helpers. |
7 | 7 | * |
8 | - * @param $path |
|
8 | + * @param string $path |
|
9 | 9 | * |
10 | 10 | * @return string |
11 | 11 | */ |
@@ -156,6 +156,7 @@ discard block |
||
156 | 156 | * If that view doesn't exist, it will load the one from the original theme. |
157 | 157 | * |
158 | 158 | * @param string (see config/backpack/base.php) |
159 | + * @param string $view |
|
159 | 160 | * |
160 | 161 | * @return string |
161 | 162 | */ |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! function_exists('backpack_url')) { |
|
3 | +if (!function_exists('backpack_url')) { |
|
4 | 4 | /** |
5 | 5 | * Appends the configured backpack prefix and returns |
6 | 6 | * the URL using the standard Laravel helpers. |
@@ -11,13 +11,13 @@ discard block |
||
11 | 11 | */ |
12 | 12 | function backpack_url($path = null, $parameters = [], $secure = null) |
13 | 13 | { |
14 | - $path = ! $path || (substr($path, 0, 1) == '/') ? $path : '/'.$path; |
|
14 | + $path = !$path || (substr($path, 0, 1) == '/') ? $path : '/'.$path; |
|
15 | 15 | |
16 | 16 | return url(config('backpack.base.route_prefix', 'admin').$path, $parameters = [], $secure = null); |
17 | 17 | } |
18 | 18 | } |
19 | 19 | |
20 | -if (! function_exists('backpack_authentication_column')) { |
|
20 | +if (!function_exists('backpack_authentication_column')) { |
|
21 | 21 | /** |
22 | 22 | * Return the username column name. |
23 | 23 | * The Laravel default (and Backpack default) is 'email'. |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | } |
31 | 31 | } |
32 | 32 | |
33 | -if (! function_exists('backpack_users_have_email')) { |
|
33 | +if (!function_exists('backpack_users_have_email')) { |
|
34 | 34 | /** |
35 | 35 | * Check if the email column is present on the user table. |
36 | 36 | * |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
48 | -if (! function_exists('backpack_avatar_url')) { |
|
48 | +if (!function_exists('backpack_avatar_url')) { |
|
49 | 49 | /** |
50 | 50 | * Returns the avatar URL of a user. |
51 | 51 | * |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | } |
79 | 79 | } |
80 | 80 | |
81 | -if (! function_exists('backpack_middleware')) { |
|
81 | +if (!function_exists('backpack_middleware')) { |
|
82 | 82 | /** |
83 | 83 | * Return the key of the middleware used across Backpack. |
84 | 84 | * That middleware checks if the visitor is an admin. |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | } |
94 | 94 | } |
95 | 95 | |
96 | -if (! function_exists('backpack_guard_name')) { |
|
96 | +if (!function_exists('backpack_guard_name')) { |
|
97 | 97 | /* |
98 | 98 | * Returns the name of the guard defined |
99 | 99 | * by the application config |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | } |
105 | 105 | } |
106 | 106 | |
107 | -if (! function_exists('backpack_auth')) { |
|
107 | +if (!function_exists('backpack_auth')) { |
|
108 | 108 | /* |
109 | 109 | * Returns the user instance if it exists |
110 | 110 | * of the currently authenticated admin |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | } |
117 | 117 | } |
118 | 118 | |
119 | -if (! function_exists('backpack_user')) { |
|
119 | +if (!function_exists('backpack_user')) { |
|
120 | 120 | /* |
121 | 121 | * Returns back a user instance without |
122 | 122 | * the admin guard, however allows you |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | } |
129 | 129 | } |
130 | 130 | |
131 | -if (! function_exists('mb_ucfirst')) { |
|
131 | +if (!function_exists('mb_ucfirst')) { |
|
132 | 132 | /** |
133 | 133 | * Capitalize the first letter of a string, |
134 | 134 | * even if that string is multi-byte (non-latin alphabet). |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | } |
151 | 151 | } |
152 | 152 | |
153 | -if (! function_exists('backpack_view')) { |
|
153 | +if (!function_exists('backpack_view')) { |
|
154 | 154 | /** |
155 | 155 | * Returns a new displayable view based on the configured backpack view namespace. |
156 | 156 | * If that view doesn't exist, it will load the one from the original theme. |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | |
170 | 170 | $returnView = $theme.$view; |
171 | 171 | |
172 | - if (! view()->exists($returnView)) { |
|
172 | + if (!view()->exists($returnView)) { |
|
173 | 173 | $returnView = $originalTheme.$view; |
174 | 174 | } |
175 | 175 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | } |
178 | 178 | } |
179 | 179 | |
180 | -if (! function_exists('square_brackets_to_dots')) { |
|
180 | +if (!function_exists('square_brackets_to_dots')) { |
|
181 | 181 | /** |
182 | 182 | * Turns a string from bracket-type array to dot-notation array. |
183 | 183 | * Ex: array[0][property] turns into array.0.property. |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | } |
195 | 195 | } |
196 | 196 | |
197 | -if (! function_exists('is_countable')) { |
|
197 | +if (!function_exists('is_countable')) { |
|
198 | 198 | /** |
199 | 199 | * We need this because is_countable was only introduced in PHP 7.3, |
200 | 200 | * and in PHP 7.2 you should check if count() argument is really countable. |
@@ -16,7 +16,7 @@ |
||
16 | 16 | 'middleware' => 'web', |
17 | 17 | 'prefix' => config('backpack.base.route_prefix'), |
18 | 18 | ], |
19 | -function () { |
|
19 | +function() { |
|
20 | 20 | // if not otherwise configured, setup the auth routes |
21 | 21 | if (config('backpack.base.setup_auth_routes')) { |
22 | 22 | // Authentication Routes... |
@@ -10,5 +10,5 @@ |
||
10 | 10 | 'prefix' => config('backpack.base.route_prefix', 'admin'), |
11 | 11 | 'middleware' => ['web', config('backpack.base.middleware_key', 'admin')], |
12 | 12 | 'namespace' => 'App\Http\Controllers\Admin', |
13 | -], function () { // custom admin routes |
|
13 | +], function() { // custom admin routes |
|
14 | 14 | }); // this should be the absolute last line of this file |
@@ -25,9 +25,9 @@ |
||
25 | 25 | </thead> |
26 | 26 | <?php |
27 | 27 | |
28 | -if (! empty($_POST)) { |
|
28 | +if (!empty($_POST)) { |
|
29 | 29 | foreach ($_POST as $key => $value) { |
30 | - if ((! is_string($value) && ! is_numeric($value)) || ! is_string($key)) { |
|
30 | + if ((!is_string($value) && !is_numeric($value)) || !is_string($key)) { |
|
31 | 31 | continue; |
32 | 32 | } |
33 | 33 |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $sourceFile = $this->sourcePath.$file.'.blade.php'; |
74 | 74 | $copiedFile = $this->destinationPath.$file.'.blade.php'; |
75 | 75 | |
76 | - if (! file_exists($sourceFile)) { |
|
76 | + if (!file_exists($sourceFile)) { |
|
77 | 77 | return $this->error( |
78 | 78 | 'Cannot find source view file at ' |
79 | 79 | .$sourceFile. |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | if ($canCopy) { |
94 | 94 | $path = pathinfo($copiedFile); |
95 | 95 | |
96 | - if (! file_exists($path['dirname'])) { |
|
96 | + if (!file_exists($path['dirname'])) { |
|
97 | 97 | mkdir($path['dirname'], 0755, true); |
98 | 98 | } |
99 | 99 |
@@ -33,15 +33,15 @@ |
||
33 | 33 | { |
34 | 34 | $this->info('Creating a new user'); |
35 | 35 | |
36 | - if (! $name = $this->option('name')) { |
|
36 | + if (!$name = $this->option('name')) { |
|
37 | 37 | $name = $this->ask('Name'); |
38 | 38 | } |
39 | 39 | |
40 | - if (! $email = $this->option('email')) { |
|
40 | + if (!$email = $this->option('email')) { |
|
41 | 41 | $email = $this->ask('Email'); |
42 | 42 | } |
43 | 43 | |
44 | - if (! $password = $this->option('password')) { |
|
44 | + if (!$password = $this->option('password')) { |
|
45 | 45 | $password = $this->secret('Password'); |
46 | 46 | } |
47 | 47 |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | private function runConsoleCommand($command) |
50 | 50 | { |
51 | 51 | $process = new Process($command, null, null, null, 60, null); |
52 | - $process->run(function ($type, $buffer) { |
|
52 | + $process->run(function($type, $buffer) { |
|
53 | 53 | if (Process::ERR === $type) { |
54 | 54 | $this->line($buffer); |
55 | 55 | } else { |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | }); |
59 | 59 | |
60 | 60 | // executes after the command finishes |
61 | - if (! $process->isSuccessful()) { |
|
61 | + if (!$process->isSuccessful()) { |
|
62 | 62 | throw new ProcessFailedException($process); |
63 | 63 | } |
64 | 64 | } |