Skip to content

Commit 3b0e685

Browse files
Fix crash when using JoliNotif@3 (#179)
1 parent 5e229df commit 3b0e685

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Notification.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Spatie\PhpUnitWatcher;
44

5+
use Joli\JoliNotif\DefaultNotifier;
56
use Joli\JoliNotif\Notification as JoliNotification;
67
use Joli\JoliNotif\NotifierFactory;
78

@@ -40,6 +41,8 @@ public function failingTests()
4041

4142
protected function send()
4243
{
43-
return NotifierFactory::create()->send($this->joliNotification);
44+
return class_exists(NotifierFactory::class)
45+
? NotifierFactory::create()->send($this->joliNotification) // Removed in JoliNotif 3
46+
: (new DefaultNotifier())->send($this->joliNotification);
4447
}
4548
}

0 commit comments

Comments
 (0)