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

AuthenticationContextFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
crap 2
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