ProviderHelper   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A providerMappingToKeyValue() 0 14 3
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 */
6
7
namespace flipbox\saml\core\helpers;
8
9
use flipbox\saml\core\records\ProviderInterface;
10
11
class ProviderHelper
12
{
13
    public static function providerMappingToKeyValue(ProviderInterface $provider)
14
    {
15
        $mapping = $provider->getMapping();
16
        if (! is_array($mapping)) {
17
            return [];
18
        }
19
20
        $newMap = [];
21
        foreach ($mapping as $map) {
22
            $newMap[$map['attributeName']] = $map['craftProperty'];
23
        }
24
25
        return $newMap;
26
    }
27
}
28