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 — develop ( d086ba...3d5dc4 )
by Jasper
02:53
created

Configuration::overrideGmailStyle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
/**
4
 * @license https://github.com/f500/swiftmailer-sparkpost/blob/master/LICENSE Proprietary
5
 */
6
7
namespace SwiftSparkPost;
8
9
/**
10
 * @copyright Future500 B.V.
11
 * @author    Jasper N. Brouwer <[email protected]>
12
 */
13
final class Configuration
14
{
15
    /**
16
     * @var string
17
     */
18
    private $recipientOverride;
19
20
    /**
21
     * @var bool
22
     */
23
    private $overrideGmailStyle;
24
25
    /**
26
     * @return Configuration
27
     */
28 24
    public static function newInstance()
29
    {
30 24
        return new self();
31
    }
32
33 57
    public function __construct()
34
    {
35 57
        $this->recipientOverride  = '';
36 57
        $this->overrideGmailStyle = false;
37 57
    }
38
39 42
    public function overrideRecipients()
40
    {
41 42
        return $this->recipientOverride !== '';
42
    }
43
44
    /**
45
     * @return bool
46
     */
47 18
    public function overrideGmailStyle()
48
    {
49 18
        return $this->overrideGmailStyle;
50
    }
51
52
    /**
53
     * @param bool $overrideGmailStyle
54
     *
55
     * @return Configuration
56
     */
57 9
    public function setOverrideGmailStyle($overrideGmailStyle)
58
    {
59 9
        $this->overrideGmailStyle = (bool) $overrideGmailStyle;
60
61 9
        return $this;
62
    }
63
64
    /**
65
     * @return string
66
     */
67 18
    public function getRecipientOverride()
68
    {
69 18
        return $this->recipientOverride;
70
    }
71
72
    /**
73
     * @param string $recipientOverride
74
     *
75
     * @return Configuration
76
     * @throws Exception
77
     */
78 18
    public function setRecipientOverride($recipientOverride)
79
    {
80 18
        if (!filter_var($recipientOverride, FILTER_VALIDATE_EMAIL)) {
81 3
            throw new Exception('Recipient override must be a valid email address');
82
        }
83
84 15
        $this->recipientOverride = (string) $recipientOverride;
85
86 15
        return $this;
87
    }
88
}
89