Passed
Push — master ( 59e178...7dbd33 )
by Michael
02:26
created

IncludedObjectsContainer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addIncludedObject() 0 4 1
A getIncludedObjects() 0 4 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
    public function addIncludedObject($object)
26
    {
27
        $this->includedObjects[] = $object;
28
    }
29
30
    /**
31
     * Get objects included to document
32
     *
33
     * @return array
34
     */
35
    public function getIncludedObjects(): array
36
    {
37
        return $this->includedObjects;
38
    }
39
}