Passed
Push — 3.x ( 885785...4e5cb3 )
by Aleksei
01:36
created

Embedded   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 5
dl 0
loc 20
ccs 5
cts 5
cp 1
rs 10
c 1
b 0
f 1
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getInverse() 0 3 1
A __construct() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cycle\Annotated\Annotation\Relation;
6
7
use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
8
use JetBrains\PhpStorm\ExpectedValues;
9
10
/**
11
 * @Annotation
12
 * @NamedArgumentConstructor
13
 * @Target("PROPERTY")
14
 */
15
#[\Attribute(\Attribute::TARGET_PROPERTY), NamedArgumentConstructor]
16
final class Embedded extends Relation
17
{
18
    protected const TYPE = 'embedded';
19
20
    /**
21
     * @param non-empty-string $target Entity to embed.
0 ignored issues
show
Documentation Bug introduced by
The doc comment non-empty-string at position 0 could not be parsed: Unknown type name 'non-empty-string' at position 0 in non-empty-string.
Loading history...
22
     * @param non-empty-string $load Relation load approach.
23
     */
24 24
    public function __construct(
25
        string $target,
26
        #[ExpectedValues(values: ['lazy', 'eager'])]
27
        string $load = 'eager'
28
    ) {
29 24
        parent::__construct($target, $load);
30 24
    }
31
32 24
    public function getInverse(): ?Inverse
33
    {
34 24
        return null;
35
    }
36
}
37