Completed
Push — 8.7 ( b6d8c1...3ac046 )
by Markus
06:49
created

PartyContainer   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getIdpEntityDescriptorStore() 0 3 1
A getSpEntityDescriptorStore() 0 3 1
A getTrustOptionsStore() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DMK\MKSamlAuth\Container;
6
7
use DMK\MKSamlAuth\EntityDescriptor\IdpEntityDescriptorStore;
8
use DMK\MKSamlAuth\EntityDescriptor\SpEntityDescriptorStore;
9
use LightSaml\Build\Container\PartyContainerInterface;
10
use LightSaml\Meta\TrustOptions\TrustOptions;
11
use LightSaml\Store\TrustOptions\FixedTrustOptionsStore;
12
use TYPO3\CMS\Core\SingletonInterface;
13
14
class PartyContainer implements PartyContainerInterface, SingletonInterface
15
{
16
    /**
17
     * @var SingletonContainer
18
     */
19
    private $container;
20
21
    public function __construct(SingletonContainer $container)
22
    {
23
        $this->container = $container;
24
    }
25
26
    public function getIdpEntityDescriptorStore()
27
    {
28
        return $this->container->getInstance(IdpEntityDescriptorStore::class);
29
    }
30
31
    public function getSpEntityDescriptorStore()
32
    {
33
        return $this->container->getInstance(SpEntityDescriptorStore::class);;
34
    }
35
36
    public function getTrustOptionsStore()
37
    {
38
        /** @var FixedTrustOptionsStore $trustStore */
39
        $trustStore = $this->container->getInstance(FixedTrustOptionsStore::class);
40
        $trustStore->setTrustOptions(new TrustOptions());
41
42
        return $trustStore;
43
    }
44
}
45