ExtensionManager::process()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * The MIT License (MIT)
7
 *
8
 * Copyright (c) 2014-2019 Spomky-Labs
9
 *
10
 * This software may be modified and distributed under the terms
11
 * of the MIT license.  See the LICENSE file for details.
12
 */
13
14
namespace OAuth2Framework\Component\AuthorizationEndpoint\Extension;
15
16
use OAuth2Framework\Component\AuthorizationEndpoint\AuthorizationRequest\AuthorizationRequest;
17
use Psr\Http\Message\ServerRequestInterface;
18
19
class ExtensionManager
20
{
21
    /**
22
     * @var Extension[]
23
     */
24
    private $extensions = [];
25
26
    public function add(Extension $extension): void
27
    {
28
        $this->extensions[] = $extension;
29
    }
30
31
    public function process(ServerRequestInterface $request, AuthorizationRequest $authorization): void
32
    {
33
        foreach ($this->extensions as $extension) {
34
            $extension->process($request, $authorization);
35
        }
36
    }
37
}
38