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::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
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