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.
Completed
Push — master ( 470965...f7c466 )
by Alexey
02:50
created

Email   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 31
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
A getTarget() 0 4 1
1
<?php
2
3
namespace NotificationChannels\Pushbullet\Targets;
4
5
use NotificationChannels\Pushbullet\Exceptions\CouldNotSendNotification;
6
7
class Email implements Targetable
8
{
9
    /**
10
     * Recipient email.
11
     *
12
     * @var string
13
     */
14
    private $email;
15
16
    /**
17
     * Set recipient email.
18
     *
19
     * @param  string  $email
20
     */
21 2
    public function __construct($email)
22
    {
23 2
        if (filter_var($email, FILTER_VALIDATE_EMAIL) === false) {
24 1
            throw CouldNotSendNotification::providedEmailIsInvalid($email);
25
        }
26
27 1
        $this->email = $email;
28 1
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33 1
    public function getTarget()
34
    {
35 1
        return ['email' => $this->email];
36
    }
37
}
38