IdpSsoStateAction::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 2
1
<?php
2
3
/*
4
 * This file is part of the LightSAML-IDP package.
5
 *
6
 * (c) Milos Tomic <[email protected]>
7
 *
8
 * This source file is subject to the GPL-3 license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace LightSaml\Idp\Action\Assertion\Outbound;
13
14
use LightSaml\Action\Assertion\AbstractAssertionAction;
15
use LightSaml\Context\Profile\AssertionContext;
16
use LightSaml\Resolver\Session\SessionProcessorInterface;
17
use Psr\Log\LoggerInterface;
18
19
class IdpSsoStateAction extends AbstractAssertionAction
20
{
21
    /** @var SessionProcessorInterface */
22
    private $sessionProcessor;
23
24
    /**
25
     * @param LoggerInterface           $logger
26
     * @param SessionProcessorInterface $sessionProcessor
27
     */
28
    public function __construct(LoggerInterface $logger, SessionProcessorInterface $sessionProcessor)
29
    {
30
        parent::__construct($logger);
31
32
        $this->sessionProcessor = $sessionProcessor;
33
    }
34
35
    /**
36
     * @param AssertionContext $context
37
     *
38
     * @return void
39
     */
40
    protected function doExecute(AssertionContext $context)
41
    {
42
        if ($context->getAssertion()) {
43
            $this->sessionProcessor->processAssertions(
44
                array($context->getAssertion()),
45
                $context->getProfileContext()->getOwnEntityDescriptor()->getEntityID(),
46
                $context->getProfileContext()->getPartyEntityDescriptor()->getEntityID()
47
            );
48
        }
49
    }
50
}
51