Completed
Pull Request — master (#84)
by Robbie
08:46 queued 06:42
created

SAMLHelper   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getSAMLauth() 0 5 1
1
<?php
2
3
namespace SilverStripe\ActiveDirectory\Helpers;
4
5
use OneLogin_Saml2_Auth;
6
use SilverStripe\Core\Object;
7
8
/**
9
 * Class SAMLHelper
10
 *
11
 * SAMLHelper acts as a simple wrapper for the OneLogin implementation, so that we can configure
12
 * and inject it via the config system.
13
 */
14
class SAMLHelper extends Object
15
{
16
    /**
17
     * @var array
18
     */
19
    public static $dependencies = [
20
        'SAMLConfService' => '%$SilverStripe\\ActiveDirectory\\Services\\SAMLConfiguration',
21
    ];
22
23
    /**
24
     * @var SAMLConfiguration
25
     */
26
    public $SAMLConfService;
27
28
    /**
29
     * @return OneLogin_Saml2_Auth
30
     */
31
    public function getSAMLauth()
32
    {
33
        $samlConfig = $this->SAMLConfService->asArray();
34
        return new OneLogin_Saml2_Auth($samlConfig);
35
    }
36
}
37