OneToOne::fetch()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 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