Completed
Pull Request — master (#343)
by Luc
04:51
created

CompositePsr7RequestAuthorizer::authorize()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
3
namespace CultuurNet\UDB3\Http;
4
5
use Psr\Http\Message\RequestInterface;
6
7
class CompositePsr7RequestAuthorizer implements Psr7RequestAuthorizerInterface
8
{
9
    /**
10
     * @var Psr7RequestAuthorizerInterface[]
11
     */
12
    private $psr7RequestAuthorizers;
13
14
    /**
15
     * @param Psr7RequestAuthorizerInterface[] $psr7RequestAuthorizers
16
     */
17
    public function __construct(Psr7RequestAuthorizerInterface... $psr7RequestAuthorizers)
18
    {
19
        $this->psr7RequestAuthorizers = $psr7RequestAuthorizers;
0 ignored issues
show
Documentation Bug introduced by
It seems like $psr7RequestAuthorizers of type array<integer,array<inte...tAuthorizerInterface>>> is incompatible with the declared type array<integer,object<Cul...stAuthorizerInterface>> of property $psr7RequestAuthorizers.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
20
    }
21
22
    /**
23
     * @inheritdoc
24
     */
25
    public function authorize(RequestInterface $request)
26
    {
27
        foreach ($this->psr7RequestAuthorizers as $psr7RequestAuthorizer) {
28
            $request = $psr7RequestAuthorizer->authorize($request);
29
        }
30
31
        return $request;
32
    }
33
}
34