Completed
Push — master ( a3b3fc...7ff218 )
by Jasper
18s queued 12s
created

AbstractOneRelation::hasIncluded()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Swis\JsonApi\Client\Relations;
4
5
use Swis\JsonApi\Client\Interfaces\ItemInterface;
6
use Swis\JsonApi\Client\Interfaces\OneRelationInterface;
7
8
/**
9
 * @property \Swis\JsonApi\Client\Interfaces\ItemInterface|false|null $included
10
 */
11
abstract class AbstractOneRelation extends AbstractRelation implements OneRelationInterface
12
{
13
    /**
14
     * @param \Swis\JsonApi\Client\Interfaces\ItemInterface $included
15
     *
16
     * @return $this
17
     */
18 378
    public function associate(ItemInterface $included)
19
    {
20 378
        $this->included = $included;
21
22 378
        return $this;
23
    }
24
25
    /**
26
     * @return \Swis\JsonApi\Client\Interfaces\ItemInterface|null
27
     */
28 315
    public function getIncluded(): ? ItemInterface
29
    {
30 315
        return $this->included ?: null;
31
    }
32
}
33