RestRequestOptionsRegistry   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 26
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A registerRestRequestOptions() 0 4 1
A getRestRequestOptionsForController() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Paysera\Bundle\ApiBundle\Service;
5
6
use Paysera\Bundle\ApiBundle\Entity\RestRequestOptions;
7
8
/**
9
 * @internal
10
 */
11
class RestRequestOptionsRegistry
12
{
13
    /**
14
     * @var array|RestRequestOptions[] associative array
15
     */
16
    private $restRequestOptionsByController;
17
18 96
    public function __construct()
19
    {
20 96
        $this->restRequestOptionsByController = [];
21 96
    }
22
23 96
    public function registerRestRequestOptions(RestRequestOptions $options, string $controller)
24
    {
25 96
        $this->restRequestOptionsByController[$controller] = $options;
26 96
    }
27
28
    /**
29
     * @param string $controller
30
     * @return RestRequestOptions|null
31
     */
32 37
    public function getRestRequestOptionsForController(string $controller)
33
    {
34 37
        return $this->restRequestOptionsByController[$controller] ?? null;
35
    }
36
}
37