Data   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 48
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getDataContainer() 0 4 1
A getEntity() 0 4 1
1
<?php
2
/**
3
 * @link    https://github.com/nnx-framework/jms-serializer-module
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace Nnx\JmsSerializerModule\ObjectConstructor\DoctrineObjectConstructor;
7
8
use Nnx\JmsSerializerModule\DataContainer\DataContainerInterface;
9
use Nnx\JmsSerializerModule\DataContainer\EntityInterface;
10
11
/**
12
 * Class Data
13
 *
14
 * @package Nnx\JmsSerializerModule\ObjectConstructor\DoctrineObjectConstructor
15
 */
16
class Data implements DataInterface
17
{
18
    /**
19
     * Контейнер с данными
20
     *
21
     * @var DataContainerInterface
22
     */
23
    protected $dataContainer;
24
25
    /**
26
     * Сущность для которой происходит запрос
27
     *
28
     * @var EntityInterface
29
     */
30
    protected $entity;
31
32
    /**
33
     * Data constructor.
34
     *
35
     * @param DataContainerInterface $dataContainer
36
     * @param EntityInterface        $entity
37
     */
38
    public function __construct(DataContainerInterface $dataContainer, EntityInterface $entity)
39
    {
40
        $this->dataContainer = $dataContainer;
41
        $this->entity = $entity;
42
    }
43
44
    /**
45
     * Возвращает контейнер с данными
46
     *
47
     * @return DataContainerInterface
48
     */
49
    public function getDataContainer()
50
    {
51
        return $this->dataContainer;
52
    }
53
54
    /**
55
     * Возвращает сущность для которой происходит запрос
56
     *
57
     * @return EntityInterface
58
     */
59
    public function getEntity()
60
    {
61
        return $this->entity;
62
    }
63
}
64