diff --git a/src/Card.php b/src/Card.php index e27eba2..d67b665 100644 --- a/src/Card.php +++ b/src/Card.php @@ -28,7 +28,7 @@ class Card implements Arrayable * @param string|null $imageStyle Configure the avatar image style, one of IMAGE or AVATAR * @return self */ - public function header(string $title, string $subtitle = null, string $imageUrl = null, string $imageStyle = null): Card + public function header(string $title, ?string $subtitle = null, ?string $imageUrl = null, ?string $imageStyle = null): Card { $header = [ 'title' => $title, diff --git a/src/Components/Button/ImageButton.php b/src/Components/Button/ImageButton.php index 908d559..10b167c 100644 --- a/src/Components/Button/ImageButton.php +++ b/src/Components/Button/ImageButton.php @@ -54,7 +54,7 @@ public function setIconByUrl(string $url): ImageButton * @param string|null $icon Either an icon name or URL to the icon image * @return self */ - public static function create(string $url = null, string $icon = null): ImageButton + public static function create(?string $url = null, ?string $icon = null): ImageButton { $button = new static; diff --git a/src/Components/Button/TextButton.php b/src/Components/Button/TextButton.php index b2287bf..d8646f6 100644 --- a/src/Components/Button/TextButton.php +++ b/src/Components/Button/TextButton.php @@ -24,7 +24,7 @@ public function text(string $text): TextButton * @param string|null $displayText * @return self */ - public static function create(string $url = null, string $displayText = null): TextButton + public static function create(?string $url = null, ?string $displayText = null): TextButton { $button = new static; diff --git a/src/GoogleChatMessage.php b/src/GoogleChatMessage.php index edeec17..b5d530c 100644 --- a/src/GoogleChatMessage.php +++ b/src/GoogleChatMessage.php @@ -157,7 +157,7 @@ public function monospaceBlock(string $message): GoogleChatMessage * @param string|null $displayText * @return self */ - public function link(string $link, string $displayText = null): GoogleChatMessage + public function link(string $link, ?string $displayText = null): GoogleChatMessage { if ($displayText) { $link = "<{$link}|{$displayText}>"; @@ -188,7 +188,7 @@ public function mention(string $userId): GoogleChatMessage * @param string|null $appendText * @return self */ - public function mentionAll(string $prependText = null, string $appendText = null): GoogleChatMessage + public function mentionAll(?string $prependText = null, ?string $appendText = null): GoogleChatMessage { $this->text("{$prependText}{$appendText}"); @@ -262,7 +262,7 @@ private function castNestedArrayables($value) * @param string|null $text * @return self */ - public static function create(string $text = null): GoogleChatMessage + public static function create(?string $text = null): GoogleChatMessage { $message = new static; diff --git a/src/Widgets/Image.php b/src/Widgets/Image.php index b717aa1..78da9eb 100644 --- a/src/Widgets/Image.php +++ b/src/Widgets/Image.php @@ -41,7 +41,7 @@ public function onClick(string $url): Image * @param string|null $onClickUrl * @return self */ - public static function create(string $imageUrl = null, string $onClickUrl = null): Image + public static function create(?string $imageUrl = null, ?string $onClickUrl = null): Image { $widget = new static; diff --git a/src/Widgets/KeyValue.php b/src/Widgets/KeyValue.php index a0b96b7..e5bfe88 100644 --- a/src/Widgets/KeyValue.php +++ b/src/Widgets/KeyValue.php @@ -109,7 +109,7 @@ public function button(AbstractButton $button): KeyValue * @param string|null $bottomLabel * @return self */ - public static function create(string $topLabel = null, string $content = null, string $bottomLabel = null): KeyValue + public static function create(?string $topLabel = null, ?string $content = null, ?string $bottomLabel = null): KeyValue { $widget = new static; diff --git a/src/Widgets/TextParagraph.php b/src/Widgets/TextParagraph.php index 2d8ee7a..13424b3 100644 --- a/src/Widgets/TextParagraph.php +++ b/src/Widgets/TextParagraph.php @@ -91,7 +91,7 @@ public function color(string $message, string $hex): TextParagraph * @param string|null $displayText * @return self */ - public function link(string $link, string $displayText = null): TextParagraph + public function link(string $link, ?string $displayText = null): TextParagraph { return $this->text("".($displayText ?? $link).''); } @@ -112,7 +112,7 @@ public function break(): TextParagraph * @param string|null $message * @return self */ - public static function create(string $message = null): TextParagraph + public static function create(?string $message = null): TextParagraph { $widget = new static; diff --git a/tests/Fixtures/TestNotifiable.php b/tests/Fixtures/TestNotifiable.php index 863d57c..a8597f9 100644 --- a/tests/Fixtures/TestNotifiable.php +++ b/tests/Fixtures/TestNotifiable.php @@ -10,7 +10,7 @@ class TestNotifiable private $space; - public function __construct(string $space = null) + public function __construct(?string $space = null) { $this->space = $space; } diff --git a/tests/GoogleChatChannelTest.php b/tests/GoogleChatChannelTest.php index f0884e6..ff4e288 100644 --- a/tests/GoogleChatChannelTest.php +++ b/tests/GoogleChatChannelTest.php @@ -229,7 +229,7 @@ private function newNotification(): TestNotification return new TestNotification; } - private function newNotifiable(string $space = null): TestNotifiable + private function newNotifiable(?string $space = null): TestNotifiable { return new TestNotifiable($space); }