GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Notification   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 3
dl 0
loc 38
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 8 1
A __construct() 0 4 1
A passingTests() 0 6 1
A failingTests() 0 6 1
A send() 0 4 1
1
<?php
2
3
namespace Spatie\PhpUnitWatcher;
4
5
use Joli\JoliNotif\Notification as JoliNotification;
6
use Joli\JoliNotif\NotifierFactory;
7
8
class Notification
9
{
10
    /** @var \Joli\JoliNotif\Notification */
11
    protected $joliNotification;
12
13
    public static function create()
14
    {
15
        $joliNotification = (new JoliNotification)
16
            ->setTitle('PHPUnit Watcher')
17
            ->setIcon(__DIR__.'/../images/notificationIcon.png');
18
19
        return new static($joliNotification);
20
    }
21
22
    protected function __construct(JoliNotification $joliNotification)
23
    {
24
        $this->joliNotification = $joliNotification;
25
    }
26
27
    public function passingTests()
28
    {
29
        $this->joliNotification->setBody('✅ Tests passed!');
30
31
        $this->send();
32
    }
33
34
    public function failingTests()
35
    {
36
        $this->joliNotification->setBody('❌ Tests failed!');
37
38
        $this->send();
39
    }
40
41
    protected function send()
42
    {
43
        return NotifierFactory::create()->send($this->joliNotification);
44
    }
45
}
46