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 ( c52a20...2910fe )
by
unknown
03:14 queued 18s
created

GssfConfig   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 37
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getSecondFactorTypes() 0 4 1
A getLoaMap() 0 10 3
1
<?php
2
3
/**
4
 * Copyright 2017 SURFnet bv
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 *     http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
19
namespace Surfnet\StepupBundle\Value;
20
21
22
class GssfConfig
23
{
24
    /**
25
     * @var array
26
     */
27
    private $config;
28
29
    /**
30
     * @param array $config
31
     */
32
    public function __construct(array $config = [])
33
    {
34
        $this->config = $config;
35
    }
36
37
    /**
38
     * @return array
39
     */
40
    public function getSecondFactorTypes()
41
    {
42
        return array_keys($this->config);
43
    }
44
45
    /**
46
     * Flattens the config and returns key value pairs where the key is the SF type and the value is the LOA level
47
     */
48
    public function getLoaMap()
49
    {
50
        $loaMap = [];
51
        foreach ($this->config as $key => $config) {
52
            if (array_key_exists('loa', $config)) {
53
                $loaMap[$key] = $config['loa'];
54
            }
55
        }
56
        return $loaMap;
57
    }
58
}