ResourceParam   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 1
eloc 9
c 3
b 0
f 0
dl 0
loc 23
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BEAR\Resource\Annotation;
6
7
use Attribute;
8
use Ray\Di\Di\Qualifier;
9
10
#[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_PARAMETER)]
11
#[Qualifier]
12
final class ResourceParam implements RequestParamInterface
13
{
14
    /** @var string */
15
    public $param;
16
17
    /** @var string */
18
    public $uri;
19
20
    /** @var bool */
21
    public $templated;
22
23
    /**
24
     * @param array{uri?: string, param?: string, templated?: bool} $values
25
     *
26
     * @SuppressWarnings(PHPMD.BooleanArgumentFlag) $templated is configuration flag for URI template expansion
27
     */
28
    public function __construct(array $values = [], string $uri = '', string $param = '', bool $templated = false)
29
    {
30
        $this->uri = $values['uri'] ?? $uri;
31
        $this->param = $values['param'] ?? $param;
32
        $this->templated = $values['templated'] ?? $templated;
33
    }
34
}
35