We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -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 |
@@ -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; |