Completed
Push — 0.4.x ( 61ba4f )
by Dmitry
15:42 queued 15:37
created

AuthenticationContextFactory   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 38
ccs 0
cts 13
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getAttribute() 0 4 1
A getContext() 0 4 1
1
<?php
2
3
namespace Krtv\Bundle\SingleSignOnServiceProviderBundle\Context;
4
5
use Symfony\Component\HttpFoundation\ParameterBag;
6
7
/**
8
 * Class AuthenticationContext
9
 * @package Krtv\Bundle\SingleSignOnServiceProviderBundle\Context
10
 */
11
class AuthenticationContextFactory
12
{
13
    /**
14
     * @var ParameterBag
15
     */
16
    private $options;
17
18
    /**
19
     * @var string
20
     */
21
    private $attribute;
22
23
    /**
24
     * @param array        $options
25
     * @param string       $attribute
26
     */
27
    public function __construct(array $options, $attribute)
28
    {
29
        $this->options   = new ParameterBag($options);
30
        $this->attribute = $attribute;
31
    }
32
33
    /**
34
     * @return string
35
     */
36
    public function getAttribute()
37
    {
38
        return $this->attribute;
39
    }
40
41
    /**
42
     * @return AuthenticationContext
43
     */
44
    public function getContext()
45
    {
46
        return new AuthenticationContext($this->options);
47
    }
48
}
49