Asset::getSource()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * JBZoo Assets
4
 *
5
 * This file is part of the JBZoo CCK package.
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 *
9
 * @package   Assets
10
 * @license   MIT
11
 * @copyright Copyright (C) JBZoo.com,  All rights reserved.
12
 * @link      https://github.com/JBZoo/Assets
13
 * @author    Sergey Kalistratov <[email protected]>
14
 */
15
16
namespace JBZoo\Assets\Asset;
17
18
use JBZoo\Assets\Manager;
19
use JBZoo\Data\Data;
20
use JBZoo\Path\Path;
21
22
/**
23
 * Class Asset
24
 * @package JBZoo\Assets\Asset
25
 */
26
abstract class Asset
27
{
28
    const TYPE_JS_FILE    = 'js';
29
    const TYPE_JS_CODE    = 'js_code';
30
    const TYPE_JSX_FILE   = 'jsx';
31
    const TYPE_JSX_CODE   = 'jsx_code';
32
    const TYPE_CSS_FILE   = 'css';
33
    const TYPE_CSS_CODE   = 'css_code';
34
    const TYPE_LESS_FILE  = 'less';
35
    const TYPE_CALLBACK   = 'callback';
36
    const TYPE_COLLECTION = 'collection';
37
38
    /**
39
     * @var string
40
     */
41
    protected $_alias;
42
43
    /**
44
     * @var string
45
     */
46
    protected $_source;
47
48
    /**
49
     * @var array
50
     */
51
    protected $_dependencies = [];
52
53
    /**
54
     * @var array
55
     */
56
    protected $_options = [];
57
58
    /**
59
     * @var Path
60
     */
61
    protected $_path;
62
63
    /**
64
     * @var Data
65
     */
66
    protected $_params;
67
68
    /**
69
     * @var Manager
70
     */
71
    protected $_manager;
72
73
    /**
74
     * Asset constructor
75
     *
76
     * @param Manager $manager
77
     * @param string  $alias
78
     * @param mixed   $source
79
     * @param array   $dependencies
80
     * @param Data    $options
81
     */
82
    public function __construct(Manager $manager, $alias, $source, $dependencies, Data $options)
83
    {
84
        $this->_manager      = $manager;
85
        $this->_alias        = $alias;
86
        $this->_source       = $source;
87
        $this->_dependencies = (array)$dependencies;
88
        $this->_options      = $options;
0 ignored issues
show
Documentation Bug introduced by SmetDenis
It seems like $options of type object<JBZoo\Data\Data> is incompatible with the declared type array of property $_options.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
89
    }
90
91
    /**
92
     * Gets the name.
93
     *
94
     * @return string
95
     */
96
    public function getAlias()
97
    {
98
        return $this->_alias;
99
    }
100
101
    /**
102
     * Gets the dependencies.
103
     *
104
     * @return array
105
     */
106
    public function getDependencies()
107
    {
108
        return $this->_dependencies;
109
    }
110
111
    /**
112
     * Gets the source.
113
     *
114
     * @return string
115
     */
116
    public function getSource()
117
    {
118
        return $this->_source;
119
    }
120
121
    /**
122
     * Gets the type.
123
     *
124
     * @return Data
125
     */
126
    public function getOptions()
127
    {
128
        return $this->_options;
129
    }
130
131
    /**
132
     * @param array $filters
133
     * @return array
134
     */
135
    abstract public function load(array $filters = []);
136
}
137