Completed
Branch EDTR/master (dbc914)
by
unknown
09:15 queued 40s
created

ReactAssetManager   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A addAssets() 0 15 1
1
<?php
2
3
namespace EventEspresso\core\domain\services\assets;
4
5
use DomainException;
6
use EventEspresso\core\exceptions\InvalidDataTypeException;
7
use EventEspresso\core\exceptions\InvalidEntityException;
8
use EventEspresso\core\services\assets\AssetManager;
9
use EventEspresso\core\services\collections\DuplicateCollectionIdentifierException;
10
11
12
/**
13
 * ReactAssetManager
14
 * assets for domain use cases that utilize React
15
 *
16
 * @package EventEspresso\core\domain\services\assets
17
 * @author  Brent Christensen
18
 * @since   $VID:$
19
 */
20
class ReactAssetManager extends AssetManager
21
{
22
    const REACT_VERSION = '16.13.1';
23
24
    const JS_HANDLE_REACT = 'react';
25
26
    const JS_HANDLE_REACT_DOM = 'react-dom';
27
28
29
    /**
30
     * @throws InvalidDataTypeException
31
     * @throws InvalidEntityException
32
     * @throws DuplicateCollectionIdentifierException
33
     * @throws DomainException
34
     */
35
    public function addAssets()
36
    {
37
        $this->addVendorJavascript(
38
            ReactAssetManager::JS_HANDLE_REACT,
39
            [],
40
            true,
41
            ReactAssetManager::REACT_VERSION
42
        );
43
        $this->addVendorJavascript(
44
            ReactAssetManager::JS_HANDLE_REACT_DOM,
45
            [ReactAssetManager::JS_HANDLE_REACT],
46
            true,
47
            ReactAssetManager::REACT_VERSION
48
        );
49
    }
50
}
51