Embed   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BEAR\Resource\Annotation;
6
7
use Attribute;
8
use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
9
10
/**
11
 * @Annotation
12
 * @Target("METHOD")
13
 * @NamedArgumentConstructor
14
 */
15
#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
16
final class Embed
17
{
18
    /**
19
     * Relation
20
     *
21
     * @var string
22
     */
23
    public $rel;
24
25
    /**
26
     * Embed resource uri
27
     *
28
     * @var string
29
     */
30
    public $src;
31
32
    /** @param array{rel?: string, src?: string} $values */
33
    public function __construct(array $values = [], string $rel = '', string $src = '')
34
    {
35
        $this->rel = $values['rel'] ?? $rel;
36
        $this->src = $values['src'] ?? $src;
37
    }
38
}
39