OneToOne   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 8
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A fetch() 0 4 1
1
<?php
2
3
namespace ORM\Relation;
4
5
use ORM\Entity;
6
use ORM\EntityManager;
7
8
/**
9
 * OneToOne Relation
10
 *
11
 * @package ORM\Relation
12
 * @author  Thomas Flori <[email protected]>
13
 */
14
class OneToOne extends OneToMany
15
{
16
    /** {@inheritdoc} */
17 3
    public function fetch(Entity $self, EntityManager $entityManager)
18
    {
19 3
        return parent::fetch($self, $entityManager)->one();
0 ignored issues
show
Bug Compatibility introduced by
The expression parent::fetch($self, $entityManager)->one(); of type ORM\Entity|null adds the type ORM\Entity to the return on line 19 which is incompatible with the return type of the parent method ORM\Relation\OneToMany::fetch of type ORM\EntityFetcher.
Loading history...
20
    }
21
}
22