Passed
Push — master ( 7dbd33...a12ced )
by Michael
02:23
created

IncludedObjectsContainer::addIncludedObject()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Mikemirten\Bundle\JsonApiBundle\Response\Behaviour;
5
6
/**
7
 * Behaviour of a container of included objects
8
 *
9
 * @package Mikemirten\Bundle\JsonApiBundle\Response\Behaviour
10
 */
11
trait IncludedObjectsContainer
12
{
13
    /**
14
     * Objects supposed to be included to document
15
     *
16
     * @var array
17
     */
18
    protected $includedObjects;
19
20
    /**
21
     * Add included object to document
22
     *
23
     * @param mixed $object
24
     */
25 1
    public function addIncludedObject($object)
26
    {
27 1
        $this->includedObjects[] = $object;
28 1
    }
29
30
    /**
31
     * Get objects included to document
32
     *
33
     * @return array
34
     */
35 1
    public function getIncludedObjects(): array
36
    {
37 1
        return $this->includedObjects;
38
    }
39
}