@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | /** |
208 | 208 | * Alias for `addChildren`. |
209 | 209 | * |
210 | - * @param \Spatie\Html\HtmlElement|string|iterable|null $children |
|
210 | + * @param Elements\Input $child |
|
211 | 211 | * @param callable|null $mapper |
212 | 212 | * |
213 | 213 | * @return static |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | /** |
221 | 221 | * Alias for `addChildren`. |
222 | 222 | * |
223 | - * @param \Spatie\Html\HtmlElement|string|iterable|null $children |
|
223 | + * @param \Spatie\Html\HtmlElement|string|iterable|null $child |
|
224 | 224 | * @param callable|null $mapper |
225 | 225 | * |
226 | 226 | * @return static |
@@ -397,8 +397,6 @@ discard block |
||
397 | 397 | * Dynamically handle calls to the class. |
398 | 398 | * Check for methods finishing by If or fallback to Macroable. |
399 | 399 | * |
400 | - * @param string $method |
|
401 | - * @param array $parameters |
|
402 | 400 | * @return mixed |
403 | 401 | * |
404 | 402 | * @throws BadMethodCallException |
@@ -455,6 +453,7 @@ discard block |
||
455 | 453 | } |
456 | 454 | |
457 | 455 | /** |
456 | + * @param callable $mapper |
|
458 | 457 | * @return Collection |
459 | 458 | */ |
460 | 459 | protected function parseChildren($children, $mapper = null) |
@@ -3,14 +3,14 @@ |
||
3 | 3 | namespace Spatie\Html; |
4 | 4 | |
5 | 5 | use BadMethodCallException; |
6 | +use Illuminate\Contracts\Support\Arrayable; |
|
7 | +use Illuminate\Contracts\Support\Htmlable; |
|
6 | 8 | use Illuminate\Support\Collection; |
7 | 9 | use Illuminate\Support\HtmlString; |
8 | -use Spatie\Html\Exceptions\MissingTag; |
|
9 | -use Spatie\Html\Exceptions\InvalidHtml; |
|
10 | 10 | use Illuminate\Support\Traits\Macroable; |
11 | 11 | use Spatie\Html\Exceptions\InvalidChild; |
12 | -use Illuminate\Contracts\Support\Htmlable; |
|
13 | -use Illuminate\Contracts\Support\Arrayable; |
|
12 | +use Spatie\Html\Exceptions\InvalidHtml; |
|
13 | +use Spatie\Html\Exceptions\MissingTag; |
|
14 | 14 | |
15 | 15 | abstract class BaseElement implements Htmlable, HtmlElement, Arrayable |
16 | 16 | { |
@@ -9,7 +9,6 @@ |
||
9 | 9 | protected $tag = 'fieldset'; |
10 | 10 | |
11 | 11 | /** |
12 | - * @param \Spatie\Html\HtmlElement|string $text |
|
13 | 12 | * |
14 | 13 | * @return static |
15 | 14 | */ |
@@ -46,7 +46,6 @@ |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
49 | - * @param string|null $name |
|
50 | 49 | * |
51 | 50 | * @return static |
52 | 51 | */ |
@@ -9,8 +9,8 @@ |
||
9 | 9 | protected $tag = 'optgroup'; |
10 | 10 | |
11 | 11 | /** |
12 | - * @param string|null $href |
|
13 | 12 | * |
13 | + * @param string $label |
|
14 | 14 | * @return static |
15 | 15 | */ |
16 | 16 | public function label($label) |
@@ -152,6 +152,9 @@ |
||
152 | 152 | $this->children = $this->applyValueToElements($value, $this->children, $strict); |
153 | 153 | } |
154 | 154 | |
155 | + /** |
|
156 | + * @param Collection $value |
|
157 | + */ |
|
155 | 158 | protected function applyValueToElements($value, Collection $children, $strict = false) |
156 | 159 | { |
157 | 160 | return $children->map(function ($child) use ($strict, $value) { |
@@ -2,10 +2,10 @@ |
||
2 | 2 | |
3 | 3 | namespace Spatie\Html\Elements; |
4 | 4 | |
5 | +use Illuminate\Support\Collection; |
|
5 | 6 | use Illuminate\Support\Str; |
6 | -use Spatie\Html\Selectable; |
|
7 | 7 | use Spatie\Html\BaseElement; |
8 | -use Illuminate\Support\Collection; |
|
8 | +use Spatie\Html\Selectable; |
|
9 | 9 | |
10 | 10 | class Select extends BaseElement |
11 | 11 | { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | /** |
48 | 48 | * @param string|null $href |
49 | - * @param string|null $text |
|
49 | + * @param string $contents |
|
50 | 50 | * |
51 | 51 | * @return \Spatie\Html\Elements\A |
52 | 52 | */ |
@@ -58,8 +58,6 @@ discard block |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
61 | - * @param string|null $href |
|
62 | - * @param string|null $text |
|
63 | 61 | * |
64 | 62 | * @return \Spatie\Html\Elements\I |
65 | 63 | * @throws \Spatie\Html\Exceptions\InvalidHtml |
@@ -72,7 +70,7 @@ discard block |
||
72 | 70 | |
73 | 71 | /** |
74 | 72 | * @param string|null $type |
75 | - * @param string|null $text |
|
73 | + * @param string $contents |
|
76 | 74 | * |
77 | 75 | * @return \Spatie\Html\Elements\Button |
78 | 76 | */ |
@@ -321,7 +319,6 @@ discard block |
||
321 | 319 | } |
322 | 320 | |
323 | 321 | /** |
324 | - * @param string|null $value |
|
325 | 322 | * |
326 | 323 | * @return \Spatie\Html\Elements\Input |
327 | 324 | */ |
@@ -528,7 +525,6 @@ discard block |
||
528 | 525 | * a public alias for `old`. |
529 | 526 | * |
530 | 527 | * @param string $name |
531 | - * @param mixed $value |
|
532 | 528 | * |
533 | 529 | * @return mixed |
534 | 530 | */ |
@@ -2,26 +2,26 @@ |
||
2 | 2 | |
3 | 3 | namespace Spatie\Html; |
4 | 4 | |
5 | -use Spatie\Html\Elements\A; |
|
6 | -use Spatie\Html\Elements\I; |
|
7 | 5 | use Illuminate\Http\Request; |
6 | +use Illuminate\Support\Collection; |
|
7 | +use Illuminate\Support\HtmlString; |
|
8 | +use Illuminate\Support\Traits\Macroable; |
|
9 | +use Spatie\Html\Elements\A; |
|
10 | +use Spatie\Html\Elements\Button; |
|
8 | 11 | use Spatie\Html\Elements\Div; |
9 | -use Spatie\Html\Elements\Img; |
|
12 | +use Spatie\Html\Elements\Element; |
|
13 | +use Spatie\Html\Elements\Fieldset; |
|
10 | 14 | use Spatie\Html\Elements\File; |
11 | 15 | use Spatie\Html\Elements\Form; |
12 | -use Spatie\Html\Elements\Span; |
|
16 | +use Spatie\Html\Elements\I; |
|
17 | +use Spatie\Html\Elements\Img; |
|
13 | 18 | use Spatie\Html\Elements\Input; |
14 | 19 | use Spatie\Html\Elements\Label; |
15 | -use Spatie\Html\Elements\Button; |
|
16 | 20 | use Spatie\Html\Elements\Legend; |
17 | 21 | use Spatie\Html\Elements\Option; |
18 | 22 | use Spatie\Html\Elements\Select; |
19 | -use Spatie\Html\Elements\Element; |
|
20 | -use Illuminate\Support\Collection; |
|
21 | -use Illuminate\Support\HtmlString; |
|
22 | -use Spatie\Html\Elements\Fieldset; |
|
23 | +use Spatie\Html\Elements\Span; |
|
23 | 24 | use Spatie\Html\Elements\Textarea; |
24 | -use Illuminate\Support\Traits\Macroable; |
|
25 | 25 | |
26 | 26 | class Html |
27 | 27 | { |