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.
Passed
Pull Request — master (#44)
by
unknown
03:43
created

WhitelistedDomains   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 55.56%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 35
ccs 5
cts 9
cp 0.5556
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getDomains() 0 6 2
A create() 0 4 1
1
<?php
2
3
namespace Tgallice\FBMessenger\Model;
4
5
use Tgallice\FBMessenger\Model\ThreadSetting\DomainWhitelisting;
6
7
class WhitelistedDomains
8
{
9
    /**
10
     * @var array
11
     */
12
    private $data;
13
14
    /**
15
     * @param array $data
16
     */
17 1
    public function __construct(array $data)
18
    {
19 1
        $this->data = $data;
20 1
    }
21
    
22
    /**
23
     * @return array|null
24
     */
25
    public function getDomains()
26
    {
27
        return isset($this->data['data'][0][DomainWhitelisting::WHITELISTED_DOMAINS]) ?
28
        	$this->data['data'][0][DomainWhitelisting::WHITELISTED_DOMAINS] :
29
        	null;
30
    }
31
    
32
    /**
33
     * @param array $data
34
     *
35
     * @return WhitelistedDomains
36
     */
37 1
    public static function create(array $data)
38
    {
39 1
        return new self($data);
40
    }
41
}