Skip to content

Commit 3d3e2f5

Browse files
committed
Make button and link text parameter optional.
1 parent 3c64fbd commit 3d3e2f5

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/Views/Button.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,17 @@ class Button extends Component
1212
*
1313
* @param $text
1414
*/
15-
public function __construct($text = false)
15+
public function __construct(?string $text = null)
1616
{
17-
if ($text) {
18-
$this->options['text'] = $text;
19-
}
17+
$this->options['text'] = $text;
2018
}
2119

2220
/**
2321
* @param $text
2422
*
2523
* @return self
2624
*/
27-
public static function make($text): self
25+
public static function make(?string $text = null): self
2826
{
2927
return new static($text);
3028
}

src/Views/Link.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function __construct($text = false)
2424
*
2525
* @return self
2626
*/
27-
public static function make($text): self
27+
public static function make(?string $text = null): self
2828
{
2929
return new static($text);
3030
}

0 commit comments

Comments
 (0)