Completed
Pull Request — develop (#22)
by A.
03:11
created

SpecifiedConsent   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 48
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A specifies() 0 4 1
A __construct() 0 5 1
A getConsent() 0 4 1
A getReleasedAttributes() 0 4 1
1
<?php
2
3
/**
4
 * Copyright 2015 SURFnet B.V.
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 OpenConext\Profile\Value;
20
21
use Surfnet\SamlBundle\SAML2\Attribute\AttributeSet;
22
23
class SpecifiedConsent
0 ignored issues
show
Coding Style introduced by
Since you have declared the constructor as private, maybe you should also declare the class as final.
Loading history...
24
{
25
    /**
26
     * @var Consent
27
     */
28
    private $consent;
29
30
    /**
31
     * @var AttributeSet
32
     */
33
    private $releasedAttributes;
34
35
    /**
36
     * @param Consent $consent
37
     * @param AttributeSet $releasedAttributes
38
     * @return SpecifiedConsent
39
     */
40
    public static function specifies(Consent $consent, AttributeSet $releasedAttributes)
41
    {
42
        return new self($consent, $releasedAttributes);
43
    }
44
45
    /**
46
     * @param Consent $consent
47
     * @param AttributeSet $releasedAttributes
48
     */
49
    private function __construct(Consent $consent, AttributeSet $releasedAttributes)
50
    {
51
        $this->consent            = $consent;
52
        $this->releasedAttributes = $releasedAttributes;
53
    }
54
55
    /**
56
     * @return Consent
57
     */
58
    public function getConsent()
59
    {
60
        return $this->consent;
61
    }
62
63
    /**
64
     * @return AttributeSet
65
     */
66
    public function getReleasedAttributes()
67
    {
68
        return $this->releasedAttributes;
69
    }
70
}
71