Skip to content

Commit

Permalink
Rescue
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalbaljet committed Feb 9, 2023
1 parent d957436 commit a7da183
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Mails/PersistentMailFake.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function cleanStorage()
public function loadMails(): self
{
$unserialized = file_exists($this->storage)
? unserialize(file_get_contents($this->storage))
? rescue(fn () => unserialize(file_get_contents($this->storage)), [], false)
: [];

$this->mailables = $unserialized['mailables'] ?? [];
Expand Down
2 changes: 1 addition & 1 deletion src/Notifications/PersistentNotificationFake.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function cleanStorage()
public function loadNotifications(): self
{
$this->notifications = file_exists($this->storage)
? unserialize(file_get_contents($this->storage))
? rescue(fn () => unserialize(file_get_contents($this->storage)), [], false)
: [];

return $this;
Expand Down

0 comments on commit a7da183

Please sign in to comment.