Failed Conditions
Push — master ( 4bfa22...148895 )
by Guilherme
17:21 queued 09:56
created

withOrderByAnnotation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
c 1
b 0
f 0
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 168
    public function withIdAnnotation(?Annotation\Id $idAnnotation) : ToManyAssociationMetadataBuilder
16
    {
17 168
        if ($idAnnotation !== null) {
18
            throw Mapping\MappingException::illegalToManyIdentifierAssociation(
19
                $this->componentMetadata->getClassName(),
20
                $this->fieldName
21
            );
22
        }
23
24 168
        return $this;
25
    }
26
27 168
    public function withOrderByAnnotation(?Annotation\OrderBy $orderByAnnotation) : ToManyAssociationMetadataBuilder
28
    {
29 168
        $this->orderByAnnotation = $orderByAnnotation;
30
31 168
        return $this;
32
    }
33
}
34