Skip to content

Commit

Permalink
chore: use explicit nullable type (#131)
Browse files Browse the repository at this point in the history
This change is needed to avoid deprecation warnings in newer PHP version.
  • Loading branch information
nerg4l authored Jan 23, 2025
1 parent de465c0 commit d59b86d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/LaravelNotify.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,28 @@ public function __construct(Session $session)
$this->session = $session;
}

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

return $this;
}

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

return $this;
}

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

return $this;
}

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

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

public function flash(string $message, string $type = null, string $icon = null, string $model = null, string $title = null): void
public function flash(string $message, ?string $type = null, ?string $icon = null, ?string $model = null, ?string $title = null): void
{
$notifications = [
'message' => $message,
Expand Down
2 changes: 1 addition & 1 deletion src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use Mckenziearts\Notify\LaravelNotify;

if (! function_exists('notify')) {
function notify(string $message = null, string $title = null): LaravelNotify
function notify(?string $message = null, ?string $title = null): LaravelNotify
{
$notify = app('notify');

Expand Down

0 comments on commit d59b86d

Please sign in to comment.