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

ToManyAssociationMetadataBuilder   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 33.33%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 22
ccs 3
cts 9
cp 0.3333
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A withOrderByAnnotation() 0 5 1
A withIdAnnotation() 0 10 2
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