Completed
Branch EDTR/master (83b47e)
by
unknown
25:37 queued 16:41
created

EventEspressoData   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 51
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A initialize() 0 7 1
1
<?php
2
3
namespace EventEspresso\core\domain\entities\routing\data_nodes;
4
5
use DomainException;
6
use EventEspresso\core\domain\entities\routing\data_nodes\core\Api;
7
use EventEspresso\core\domain\entities\routing\data_nodes\core\Config;
8
use EventEspresso\core\domain\services\assets\EspressoCoreAppAssetManager;
9
use EventEspresso\core\services\assets\JedLocaleData;
10
use EventEspresso\core\services\json\PrimaryJsonDataNode;
11
use EventEspresso\core\services\json\JsonDataNodeValidator;
12
13
/**
14
 * Class EventEspressoData
15
 * Description
16
 *
17
 * @package EventEspresso\core\domain\entities\routing\data_nodes
18
 * @author  Brent Christensen
19
 * @since   $VID:$
20
 */
21
class EventEspressoData extends PrimaryJsonDataNode
22
{
23
24
    const NODE_NAME = 'eventEspressoData';
25
26
    /**
27
     * @var Api $api
28
     */
29
    private $api;
30
31
    /**
32
     * @var Config $config
33
     */
34
    private $config;
35
36
    /**
37
     * @var JedLocaleData $jed_locale
38
     */
39
    private $jed_locale;
40
41
42
    /**
43
     * JsonDataNodeHandler constructor.
44
     *
45
     * @param Api $api
46
     * @param Config $config
47
     * @param JedLocaleData         $jed_locale
48
     * @param JsonDataNodeValidator $validator
49
     */
50
    public function __construct(Api $api, Config $config, JedLocaleData $jed_locale, JsonDataNodeValidator $validator)
51
    {
52
        parent::__construct($validator);
53
        $this->api = $api;
54
        $this->config = $config;
55
        $this->jed_locale = $jed_locale;
56
        $this->setNodeName(EventEspressoData::NODE_NAME);
57
    }
58
59
60
    /**
61
     * @throws DomainException
62
     * @since $VID:$
63
     */
64
    public function initialize()
65
    {
66
        $this->addDataNode($this->api);
67
        $this->addDataNode($this->config);
68
        $this->addData('i18n', $this->jed_locale->getData('event_espresso'));
69
        $this->setInitialized(true);
70
    }
71
}
72