Completed
Push — develop ( 35e2e2...34d848 )
by
unknown
14s
created

InstitutionAuthorizationContext::getActorInstitution()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * Copyright 2018 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 Surfnet\StepupMiddleware\ApiBundle\Authorization\Value;
20
21
use Surfnet\Stepup\Identity\Collection\InstitutionCollection;
22
23
class InstitutionAuthorizationContext implements InstitutionAuthorizationContextInterface
24
{
25
    /**
26
     * @var InstitutionCollection|null
27
     */
28
    private $institutions;
29
30
    /**
31
     * @var bool
32
     */
33
    private $isSraa;
34
35
    /**
36
     * AuthorizationContext constructor.
37
     * @param InstitutionCollection $institutions[]
0 ignored issues
show
Documentation introduced by
There is no parameter named $institutions[]. Did you maybe mean $institutions?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
38
     * @param bool $isSraa describes if the actor is SRAA or not. Default: false
39
     */
40
    public function __construct(
41
        InstitutionCollection $institutions = null,
42
        $isSraa = false
43
    ) {
44
        $this->institutions = $institutions;
45
        $this->isSraa = $isSraa;
46
    }
47
48
    /**
49
     * @return InstitutionCollection
0 ignored issues
show
Documentation introduced by
Should the return type not be InstitutionCollection|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
50
     */
51
    public function getInstitutions()
52
    {
53
        return $this->institutions;
54
    }
55
56
    /**
57
     * @return bool
58
     */
59
    public function isActorSraa()
60
    {
61
        return $this->isSraa;
62
    }
63
}
64