@@ -13,7 +13,6 @@ |
||
13 | 13 | protected $renderable; |
14 | 14 | |
15 | 15 | /** |
16 | - * @param int $multiple |
|
17 | 16 | * |
18 | 17 | * @return string |
19 | 18 | */ |
@@ -57,6 +57,10 @@ |
||
57 | 57 | }); |
58 | 58 | } |
59 | 59 | |
60 | + /** |
|
61 | + * @param string $title |
|
62 | + * @param \Illuminate\Support\Collection $diff |
|
63 | + */ |
|
60 | 64 | protected function printDiff($title, $diff, $error = false) |
61 | 65 | { |
62 | 66 | if ($diff->isEmpty()) { |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | { |
53 | 53 | return collect(Arr::dot($from)) |
54 | 54 | ->keys() |
55 | - ->reject(function ($key) use ($to) { |
|
55 | + ->reject(function($key) use ($to) { |
|
56 | 56 | return Arr::has($to, $key); |
57 | 57 | }); |
58 | 58 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $this->line(''); |
67 | 67 | $this->comment("{$title}:"); |
68 | 68 | |
69 | - $diff->each(function ($key) use ($error) { |
|
69 | + $diff->each(function($key) use ($error) { |
|
70 | 70 | if ($error) { |
71 | 71 | $this->error(" {$key}"); |
72 | 72 | } else { |
@@ -102,9 +102,9 @@ discard block |
||
102 | 102 | */ |
103 | 103 | protected function applyCascadeConditions() |
104 | 104 | { |
105 | - if( $this->form ) { |
|
105 | + if ($this->form) { |
|
106 | 106 | $this->form->fields() |
107 | - ->filter(function (Form\Field $field) { |
|
107 | + ->filter(function(Form\Field $field) { |
|
108 | 108 | return $field instanceof CascadeGroup |
109 | 109 | && $field->dependsOn($this) |
110 | 110 | && $this->hitsCondition($field); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | return; |
163 | 163 | } |
164 | 164 | |
165 | - $cascadeGroups = collect($this->conditions)->map(function ($condition) { |
|
165 | + $cascadeGroups = collect($this->conditions)->map(function($condition) { |
|
166 | 166 | return [ |
167 | 167 | 'class' => $this->getCascadeClass($condition['value']), |
168 | 168 | 'operator' => $condition['operator'], |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace Encore\Admin\Form\Field; |
4 | 4 | |
5 | 5 | use Encore\Admin\Admin; |
6 | -use Illuminate\Support\Arr; |
|
7 | 6 | |
8 | 7 | trait HasValuePicker |
9 | 8 | { |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
68 | - * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View|string |
|
68 | + * @return string|null |
|
69 | 69 | */ |
70 | 70 | protected function renderFilePicker() |
71 | 71 | { |
@@ -89,7 +89,6 @@ discard block |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
92 | - * @param string $wrap |
|
93 | 92 | */ |
94 | 93 | public function addPickBtn($btn) |
95 | 94 | { |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | protected $append; |
16 | 16 | |
17 | 17 | /** |
18 | - * @param $string |
|
18 | + * @param string $string |
|
19 | 19 | * @return $this |
20 | 20 | */ |
21 | 21 | public function prepend($string) |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
31 | - * @param $string |
|
31 | + * @param string $string |
|
32 | 32 | * @return $this |
33 | 33 | */ |
34 | 34 | public function append($string) |
@@ -47,6 +47,9 @@ discard block |
||
47 | 47 | } |
48 | 48 | } |
49 | 49 | |
50 | + /** |
|
51 | + * @param string $attribute |
|
52 | + */ |
|
50 | 53 | protected function defaultAttribute($attribute, $value) |
51 | 54 | { |
52 | 55 | if (!array_key_exists($attribute, $this->attributes)) { |
@@ -89,7 +89,6 @@ |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
92 | - * @param string $wrap |
|
93 | 92 | */ |
94 | 93 | public function addPickBtn($btn) |
95 | 94 | { |
@@ -116,8 +116,4 @@ |
||
116 | 116 | return [ |
117 | 117 | 'url' => $this->field->objectUrl($item), |
118 | 118 | 'value' => $item, |
119 | - 'is_file' => $field == File::class, |
|
120 | - ]; |
|
121 | - }); |
|
122 | - } |
|
123 | -} |
|
119 | + 'is_file' => $field |
|
124 | 120 | \ No newline at end of file |
@@ -116,8 +116,4 @@ |
||
116 | 116 | return [ |
117 | 117 | 'url' => $this->field->objectUrl($item), |
118 | 118 | 'value' => $item, |
119 | - 'is_file' => $field == File::class, |
|
120 | - ]; |
|
121 | - }); |
|
122 | - } |
|
123 | -} |
|
119 | + 'is_file' => $field |
|
124 | 120 | \ No newline at end of file |
@@ -116,8 +116,4 @@ |
||
116 | 116 | return [ |
117 | 117 | 'url' => $this->field->objectUrl($item), |
118 | 118 | 'value' => $item, |
119 | - 'is_file' => $field == File::class, |
|
120 | - ]; |
|
121 | - }); |
|
122 | - } |
|
123 | -} |
|
119 | + 'is_file' => $field |
|
124 | 120 | \ No newline at end of file |
@@ -116,8 +116,4 @@ |
||
116 | 116 | return [ |
117 | 117 | 'url' => $this->field->objectUrl($item), |
118 | 118 | 'value' => $item, |
119 | - 'is_file' => $field == File::class, |
|
120 | - ]; |
|
121 | - }); |
|
122 | - } |
|
123 | -} |
|
119 | + 'is_file' => $field |
|
124 | 120 | \ No newline at end of file |
@@ -116,8 +116,4 @@ |
||
116 | 116 | return [ |
117 | 117 | 'url' => $this->field->objectUrl($item), |
118 | 118 | 'value' => $item, |
119 | - 'is_file' => $field == File::class, |
|
120 | - ]; |
|
121 | - }); |
|
122 | - } |
|
123 | -} |
|
119 | + 'is_file' => $field |
|
124 | 120 | \ No newline at end of file |
@@ -116,8 +116,4 @@ |
||
116 | 116 | return [ |
117 | 117 | 'url' => $this->field->objectUrl($item), |
118 | 118 | 'value' => $item, |
119 | - 'is_file' => $field == File::class, |
|
120 | - ]; |
|
121 | - }); |
|
122 | - } |
|
123 | -} |
|
119 | + 'is_file' => $field |
|
124 | 120 | \ No newline at end of file |
@@ -116,8 +116,4 @@ |
||
116 | 116 | return [ |
117 | 117 | 'url' => $this->field->objectUrl($item), |
118 | 118 | 'value' => $item, |
119 | - 'is_file' => $field == File::class, |
|
120 | - ]; |
|
121 | - }); |
|
122 | - } |
|
123 | -} |
|
119 | + 'is_file' => $field |
|
124 | 120 | \ No newline at end of file |
@@ -315,7 +315,7 @@ |
||
315 | 315 | } |
316 | 316 | |
317 | 317 | /** |
318 | - * @param $component |
|
318 | + * @param string $component |
|
319 | 319 | */ |
320 | 320 | public static function component($component, $data = []) |
321 | 321 | { |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | |
326 | 326 | libxml_use_internal_errors(true); |
327 | 327 | |
328 | - $dom->loadHTML('<?xml encoding="utf-8" ?>' . $str); |
|
328 | + $dom->loadHTML('<?xml encoding="utf-8" ?>'.$str); |
|
329 | 329 | |
330 | 330 | libxml_use_internal_errors(false); |
331 | 331 | |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | } |
335 | 335 | |
336 | 336 | if ($script = $dom->getElementsByTagName('script')[0]) { |
337 | - static::script(';(function () {' . $script->nodeValue . '})();'); |
|
337 | + static::script(';(function () {'.$script->nodeValue.'})();'); |
|
338 | 338 | } |
339 | 339 | |
340 | 340 | if ($element = $dom->getElementsByTagName('template')[0]) { |