OneToOne   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 1
c 2
b 0
f 2
lcom 1
cbo 5
dl 0
loc 19
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createAssociation() 0 7 1
1
<?php
2
3
namespace LaravelDoctrine\Fluent\Relations;
4
5
use Doctrine\ORM\Mapping\Builder\AssociationBuilder;
6
use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder;
7
use LaravelDoctrine\Fluent\Relations\Traits\Ownable;
8
use LaravelDoctrine\Fluent\Relations\Traits\Owning;
9
use LaravelDoctrine\Fluent\Relations\Traits\Primary;
10
11
/**
12
 * @method $this inversedBy($fieldName)
13
 * @method $this mappedBy($fieldName)
14
 */
15
class OneToOne extends AbstractRelation
16
{
17
    use Owning, Ownable, Primary;
18
19
    /**
20
     * @param ClassMetadataBuilder $builder
21
     * @param string               $relation
22
     * @param string               $entity
23
     *
24
     * @return AssociationBuilder
25
     */
26 24
    protected function createAssociation(ClassMetadataBuilder $builder, $relation, $entity)
27
    {
28 24
        return $this->builder->createOneToOne(
29 24
            $relation,
30
            $entity
31 24
        );
32
    }
33
}
34