Total Complexity | 4 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
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) |
||
51 | } |
||
52 | } |
||
53 |