CreateMessageIssuerAction   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 9
c 1
b 0
f 0
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A doExecute() 0 13 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\Action\Profile\Outbound\Message;
13
14
use LightSaml\Action\Profile\AbstractProfileAction;
15
use LightSaml\Context\Profile\Helper\LogHelper;
16
use LightSaml\Context\Profile\Helper\MessageContextHelper;
17
use LightSaml\Context\Profile\ProfileContext;
18
use LightSaml\Model\Assertion\Issuer;
19
use LightSaml\SamlConstants;
20
21
/**
22
 * Sets the Issuer of the outbound message to the value of own entityID.
23
 */
24
class CreateMessageIssuerAction extends AbstractProfileAction
25
{
26
    /**
27
     * @return void
28
     */
29
    protected function doExecute(ProfileContext $context)
30
    {
31
        $ownEntityDescriptor = $context->getOwnEntityDescriptor();
32
33
        $issuer = new Issuer($ownEntityDescriptor->getEntityID());
34
        $issuer->setFormat(SamlConstants::NAME_ID_FORMAT_ENTITY);
35
36
        MessageContextHelper::asSamlMessage($context->getOutboundContext())
37
            ->setIssuer($issuer);
38
39
        $this->logger->debug(
40
            sprintf('Issuer set to "%s"', $ownEntityDescriptor->getEntityID()),
41
            LogHelper::getActionContext($context, $this)
42
        );
43
    }
44
}
45