Failed Conditions
Push — master ( b07393...21bc80 )
by Guilherme
09:49
created

withIdAnnotation()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 5
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 10
ccs 0
cts 6
cp 0
crap 6
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\ORM\Mapping\Builder;
6
7
use Doctrine\ORM\Annotation;
8
use Doctrine\ORM\Mapping;
9
10
abstract class ToManyAssociationMetadataBuilder extends AssociationMetadataBuilder
11
{
12
    /** @var Annotation\OrderBy|null */
13
    protected $orderByAnnotation;
14
15
    public function withIdAnnotation(?Annotation\Id $idAnnotation) : ToManyAssociationMetadataBuilder
16
    {
17
        if ($idAnnotation !== null) {
18
            throw Mapping\MappingException::illegalToManyIdentifierAssociation(
19
                $this->componentMetadata->getClassName(),
20
                $this->fieldName
21
            );
22
        }
23
24
        return $this;
25
    }
26
27 387
    public function withOrderByAnnotation(?Annotation\OrderBy $orderByAnnotation) : ToManyAssociationMetadataBuilder
28
    {
29 387
        $this->orderByAnnotation = $orderByAnnotation;
30
31 387
        return $this;
32
    }
33
}
34