Skip to content

Commit d59b86d

Browse files
authored
chore: use explicit nullable type (#131)
This change is needed to avoid deprecation warnings in newer PHP version.
1 parent de465c0 commit d59b86d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/LaravelNotify.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,28 @@ public function __construct(Session $session)
1515
$this->session = $session;
1616
}
1717

18-
public function info(string $message, string $title = null): self
18+
public function info(string $message, ?string $title = null): self
1919
{
2020
$this->flash($message, 'info', 'flaticon-exclamation-1', 'toast', $title);
2121

2222
return $this;
2323
}
2424

25-
public function success(string $message, string $title = null): self
25+
public function success(string $message, ?string $title = null): self
2626
{
2727
$this->flash($message, 'success', 'flaticon2-check-mark', 'toast', $title);
2828

2929
return $this;
3030
}
3131

32-
public function error(string $message, string $title = null): self
32+
public function error(string $message, ?string $title = null): self
3333
{
3434
$this->flash($message, 'error', 'flaticon2-delete', 'toast', $title);
3535

3636
return $this;
3737
}
3838

39-
public function warning(string $message, string $title = null): self
39+
public function warning(string $message, ?string $title = null): self
4040
{
4141
$this->flash($message, 'warning', 'flaticon-warning-sign', 'toast', $title);
4242

@@ -110,7 +110,7 @@ public function preset(string $presetName, array $overrideValues = []): self
110110
return $this;
111111
}
112112

113-
public function flash(string $message, string $type = null, string $icon = null, string $model = null, string $title = null): void
113+
public function flash(string $message, ?string $type = null, ?string $icon = null, ?string $model = null, ?string $title = null): void
114114
{
115115
$notifications = [
116116
'message' => $message,

src/helpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use Mckenziearts\Notify\LaravelNotify;
44

55
if (! function_exists('notify')) {
6-
function notify(string $message = null, string $title = null): LaravelNotify
6+
function notify(?string $message = null, ?string $title = null): LaravelNotify
77
{
88
$notify = app('notify');
99

0 commit comments

Comments
 (0)