CreateAssertionIssuerAction::doExecute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 14
ccs 0
cts 11
cp 0
rs 9.7998
c 0
b 0
f 0
cc 1
nc 1
nop 1
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\Context\Profile\Helper\LogHelper;
17
use LightSaml\Model\Assertion\Issuer;
18
use LightSaml\SamlConstants;
19
20
/**
21
 * Creates Issuer with value of the own entityID.
22
 */
23
class CreateAssertionIssuerAction extends AbstractAssertionAction
24
{
25
    /**
26
     * @param AssertionContext $context
27
     *
28
     * @return void
29
     */
30
    protected function doExecute(AssertionContext $context)
31
    {
32
        $ownEntityDescriptor = $context->getProfileContext()->getOwnEntityDescriptor();
33
34
        $issuer = new Issuer($ownEntityDescriptor->getEntityID());
35
        $issuer->setFormat(SamlConstants::NAME_ID_FORMAT_ENTITY);
36
37
        $context->getAssertion()->setIssuer($issuer);
38
39
        $this->logger->debug(
40
            sprintf('Assertion Issuer set to "%s"', $ownEntityDescriptor->getEntityID()),
41
            LogHelper::getActionContext($context, $this)
42
        );
43
    }
44
}
45