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.

OptionsSanitizingCapabilities   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 43
ccs 23
cts 23
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B sanitizeOptions() 0 34 5
1
<?php
2
3
/**
4
 * @license https://github.com/f500/swiftmailer-sparkpost/blob/master/LICENSE MIT
5
 */
6
7
namespace SwiftSparkPost;
8
9
/**
10
 * @copyright Future500 B.V.
11
 * @author    Jasper N. Brouwer <[email protected]>
12
 */
13
trait OptionsSanitizingCapabilities
14
{
15
    /**
16
     * @param array $options
17
     *
18
     * @return array
19
     * @throws Exception
20
     */
21 39
    private function sanitizeOptions(array $options)
22
    {
23
        $booleanOptions = [
24 39
            Option::TRANSACTIONAL,
25 39
            Option::OPEN_TRACKING,
26 39
            Option::CLICK_TRACKING,
27 39
            Option::SANDBOX,
28 39
            Option::SKIP_SUPPRESSION,
29 39
            Option::INLINE_CSS,
30 13
        ];
31
        $stringOptions  = [
32 39
            Option::IP_POOL,
33 13
        ];
34
35 39
        $sanitized = [];
36
37 39
        foreach ($options as $option => $value) {
38 39
            if (in_array($option, $stringOptions, true)) {
39 30
                if ($value) {
40 24
                    $sanitized[$option] = (string) $value;
41 8
                }
42 30
                continue;
43
            }
44
45 24
            if (in_array($option, $booleanOptions, true)) {
46 18
                $sanitized[$option] = (bool) $value;
47 18
                continue;
48
            }
49
50 6
            throw new Exception(sprintf('Unknown SparkPost option "%s"', $option));
51 11
        }
52
53 33
        return $sanitized;
54
    }
55
}
56