RequestSecurityToken::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 21
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 12
nc 2
nop 0
dl 0
loc 21
ccs 9
cts 9
cp 1
crap 2
rs 9.3142
c 0
b 0
f 0
1
<?php
2
3
namespace Dgame\Soap\Component;
4
5
use Dgame\Soap\Attribute\XmlnsAttribute;
6
use Dgame\Soap\XmlElement;
7
8
/**
9
 * Class RequestSecurityToken
10
 * @package Dgame\Soap\Component
11
 */
12
final class RequestSecurityToken extends NamedNode
13
{
14 1
    public function __construct()
15
    {
16 1
        parent::__construct('ns2');
17
18 1
        //$this->setAttribute(new XmlnsAttribute('', 'http://schemas.xmlsoap.org/ws/2004/08/addressing'));
0 ignored issues
show
Unused Code Comprehensibility introduced by
74% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
19
20
        $namespaces = [
21 1
            'ns2' => 'http://schemas.xmlsoap.org/ws/2005/02/trust',
22
            'ns3' => 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd',
23
            'ns4' => 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd',
24
            'ns5' => 'http://www.w3.org/2000/09/xmldsig#',
25
            'ns6' => 'http://schemas.xmlsoap.org/ws/2004/09/policy',
26
        ];
27
28 1
        foreach ($namespaces as $name => $value) {
29 1
            $this->setAttribute(new XmlnsAttribute($name, $value));
30
        }
31
32 1
        $this->appendElement(new XmlElement('TokenType', 'http://schemas.xmlsoap.org/ws/2005/02/sc/sct'));
33 1
        $this->appendElement(new XmlElement('RequestType', 'http://schemas.xmlsoap.org/ws/2005/02/trust/Issue'));
34 1
    }
35
}
36