AssertionContextHelper   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 17
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2
ccs 0
cts 5
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getEncryptedAssertionReader() 0 9 2
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\Context\Profile\Helper;
13
14
use LightSaml\Context\Profile\AssertionContext;
15
use LightSaml\Error\LightSamlContextException;
16
use LightSaml\Model\Assertion\EncryptedAssertionReader;
17
18
abstract class AssertionContextHelper
19
{
20
    /**
21
     * @param AssertionContext $context
22
     *
23
     * @return EncryptedAssertionReader
24
     */
25
    public static function getEncryptedAssertionReader(AssertionContext $context)
26
    {
27
        $result = $context->getEncryptedAssertion();
28
        if ($result instanceof EncryptedAssertionReader) {
29
            return $result;
30
        }
31
32
        throw new LightSamlContextException($context, 'Expected EncryptedAssertionReader');
33
    }
34
}
35