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.

Config   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
c 2
b 0
f 0
lcom 1
cbo 0
dl 0
loc 27
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A addResource() 0 4 1
A getResources() 0 4 1
A addConfig() 0 6 1
1
<?php
2
3
namespace Junker\Silex;
4
5
use Symfony\Component\Config\Resource\ResourceInterface;
6
7
class Config
8
{
9
    public $data;
10
    private $resources = array();
11
12
    public function __construct(array $data)
13
    {
14
        $this->data = $data;
15
    }
16
17
    public function addResource(ResourceInterface $resource)
18
    {
19
        $this->resources[] = $resource;
20
    }
21
22
    public function getResources()
23
    {
24
        return array_unique($this->resources);
25
    }
26
27
    public function addConfig(Config $config)
28
    {
29
        $this->data = array_replace_recursive($this->data, $config->data);
30
31
        $this->resources = array_merge($this->resources, $config->getResources());
32
    }
33
}
34