Completed
Push — feature/post-binding-without-c... ( 539191...2342a3 )
by
unknown
02:39
created

Response::getAssertionConsumerServiceUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * Copyright 2017 SURFnet bv
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 *     http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
19
namespace Surfnet\StepupGateway\SecondFactorOnlyBundle\Adfs\ValueObject;
20
21
use Webmozart\Assert\Assert;
22
23
/**
24
 * Helps with setting and asserting the correct state for an ADFS response.
25
 *
26
 * @package Surfnet\StepupGateway\SecondFactorOnlyBundle\Adfs\ValueObject
27
 */
28
class Response
29
{
30
    /**
31
     * @var string
32
     */
33
    private $authMethod;
34
35
    /**
36
     * @var string
37
     */
38
    private $context;
39
40
    /**
41
     * @var string
42
     */
43
    private $acsUrl;
44
45
    /**
46
     * Creates and validates an Adfs response value object
47
     *
48
     * @param string $authMethod
49
     * @param string $context
50
     * @param string $acsUrl
51
     * @return Response
52
     */
53
    public static function fromValues($authMethod, $context, $acsUrl)
54
    {
55
        Assert::stringNotEmpty($authMethod);
56
        Assert::stringNotEmpty($context);
57
        Assert::stringNotEmpty($acsUrl);
58
59
        $response = new Response();
60
        $response->authMethod = $authMethod;
61
        $response->context = $context;
62
        $response->acsUrl = $acsUrl;
63
64
        return $response;
65
    }
66
67
    /**
68
     * @return mixed
69
     */
70
    public function getAuthMethod()
71
    {
72
        return $this->authMethod;
73
    }
74
75
    /**
76
     * @return mixed
77
     */
78
    public function getContext()
79
    {
80
        return $this->context;
81
    }
82
83
    /**
84
     * @return mixed
85
     */
86
    public function getAssertionConsumerServiceUrl()
87
    {
88
        return $this->acsUrl;
89
    }
90
}
91