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 ( d1c731...ca9b69 )
by Axel
02:45
created

ConfigurationManager::getAttributes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace PhpAbac\Manager;
4
5
use PhpAbac\Loader\YamlAbacLoader;
6
7
use Symfony\Component\Config\FileLocatorInterface;
8
9
class ConfigurationManager {
10
    /** @var FileLocatorInterface **/
11
    protected $locator;
12
    /** @var string **/
13
    protected $format;
14
    /** @var array **/
15
    protected $loaders;
16
    /** @var array **/
17
    protected $rules;
18
    /** @var array **/
19
    protected $attributes;
20
    
21
    /**
22
     * @param FileLocatorInterface $locator
23
     * @param string $format
24
     */
25 7
    public function __construct(FileLocatorInterface $locator, $format = 'yaml') {
26 7
        $this->locator = $locator;
27 7
        $this->format = $format;
28 7
        $this->attributes = [];
29 7
        $this->rules = [];
30 7
        $this->loaders['yaml'] = new YamlAbacLoader($locator);
31 7
    }
32
    
33
    /**
34
     * @param array $configurationFiles
35
     */
36 7
    public function parseConfigurationFile($configurationFiles) {
37 7
        foreach($configurationFiles as $configurationFile) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space after FOREACH keyword; 0 found
Loading history...
38 7
            $config = $this->loaders[$this->format]->load($configurationFile);
39 7
            if(isset($config['attributes'])) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space after IF keyword; 0 found
Loading history...
40 7
                $this->attributes = array_merge($this->attributes, $config['attributes']);
41 7
            }
42 7
            if(isset($config['rules'])) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space after IF keyword; 0 found
Loading history...
43 7
                $this->rules = array_merge($this->rules, $config['rules']);
44 7
            }
45 7
        }
46 7
    }
47
    
48
    /**
49
     * @return array
50
     */
51 7
    public function getAttributes() {
52 7
        return $this->attributes;
53
    }
54
    
55
    /**
56
     * @return array
57
     */
58 3
    public function getRules() {
59 3
        return $this->rules;
60
    }
61
}