StaticTrustOptionsStore   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 6
c 1
b 0
f 0
dl 0
loc 35
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A has() 0 3 1
A get() 0 3 2
A add() 0 5 1
1
<?php
2
3
/*
4
 * This file is part of the LightSAML-Core package.
5
 *
6
 * (c) Milos Tomic <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace LightSaml\Store\TrustOptions;
13
14
use LightSaml\Meta\TrustOptions\TrustOptions;
15
16
class StaticTrustOptionsStore implements TrustOptionsStoreInterface
17
{
18
    /** @var TrustOptions[] */
19
    protected $options = [];
20
21
    /**
22
     * @param string $entityId
23
     *
24
     * @return StaticTrustOptionsStore
25
     */
26
    public function add($entityId, TrustOptions $options)
27
    {
28
        $this->options[$entityId] = $options;
29
30
        return $this;
31
    }
32
33
    /**
34
     * @param string $entityId
35
     *
36
     * @return TrustOptions|null
37
     */
38
    public function get($entityId)
39
    {
40
        return isset($this->options[$entityId]) ? $this->options[$entityId] : null;
41
    }
42
43
    /**
44
     * @param string $entityId
45
     *
46
     * @return bool
47
     */
48
    public function has($entityId)
49
    {
50
        return isset($this->options[$entityId]);
51
    }
52
}
53