1 | <?php |
||
14 | class Router extends ExternalModule |
||
15 | { |
||
16 | /** @deprecated Use E_MODULES */ |
||
17 | const EVENT_START_GENERATE_RESOURCES = 'resourcer.modulelist'; |
||
18 | /** Event for modifying modules */ |
||
19 | const E_MODULES = 'resourcer.modulelist'; |
||
20 | /** Event for resources preloading */ |
||
21 | const E_RESOURCE_PRELOAD = 'resourcer.preload'; |
||
22 | /** Event for resources compiling */ |
||
23 | const E_RESOURCE_COMPILE = 'resourcer.compile'; |
||
24 | /** Event when recourse management is finished */ |
||
25 | const E_FINISHED = 'resourcer.finished'; |
||
26 | |||
27 | /** Assets types */ |
||
28 | const T_CSS = 'css'; |
||
29 | const T_LESS = 'less'; |
||
30 | const T_SCSS = 'scss'; |
||
31 | const T_SASS = 'sass'; |
||
32 | const T_JS = 'js'; |
||
33 | const T_TS = 'ts'; |
||
34 | const T_COFFEE = 'coffee'; |
||
35 | |||
36 | /** Assets converter */ |
||
37 | const CONVERTER = [ |
||
38 | self::T_JS => self::T_JS, |
||
39 | self::T_TS => self::T_JS, |
||
40 | self::T_COFFEE => self::T_JS, |
||
41 | self::T_CSS => self::T_CSS, |
||
42 | self::T_LESS => self::T_CSS, |
||
43 | self::T_SCSS => self::T_CSS, |
||
44 | self::T_SASS => self::T_CSS, |
||
45 | ]; |
||
46 | |||
47 | /** @deprecated Identifier */ |
||
48 | protected $id = STATIC_RESOURCE_HANDLER; |
||
49 | |||
50 | /** Collection of registered resource types */ |
||
51 | protected $types = [ |
||
52 | self::T_CSS, |
||
53 | self::T_JS, |
||
54 | self::T_LESS, |
||
55 | self::T_SCSS, |
||
56 | self::T_SASS, |
||
57 | self::T_COFFEE, |
||
58 | self::T_TS |
||
59 | ]; |
||
60 | |||
61 | /** @var array Assets cache */ |
||
62 | protected $cache = []; |
||
63 | |||
64 | /** @var array Template markers for inserting assets */ |
||
65 | protected $templateMarkers = [ |
||
66 | 'css' => '</head>', |
||
67 | 'js' => '</body>' |
||
68 | ]; |
||
69 | /** @var array Collection of static resources */ |
||
70 | protected $resources = []; |
||
71 | |||
72 | /** @var array Collection of static resource URLs */ |
||
73 | protected $resourceUrls = []; |
||
74 | |||
75 | /** |
||
76 | * @see ModuleConnector::init() |
||
77 | * |
||
78 | * @param array $params Initialization parameters |
||
79 | * |
||
80 | * @return bool True if module successfully initialized |
||
81 | */ |
||
82 | 1 | public function init(array $params = array()) |
|
99 | |||
100 | /** |
||
101 | * Create static assets. |
||
102 | * |
||
103 | * @param array $files Collection of paths for gathering resources |
||
104 | */ |
||
105 | 1 | public function createAssets(array $files) |
|
157 | |||
158 | 1 | private function getAssetPathData($resource, $extension = null) |
|
173 | |||
174 | /** |
||
175 | * Get asset files |
||
176 | */ |
||
177 | 1 | private function getAssets() |
|
204 | |||
205 | /** |
||
206 | * Template rendering handler by injecting static assets url |
||
207 | * in appropriate. |
||
208 | * |
||
209 | * @param $view |
||
210 | * |
||
211 | * @return mixed |
||
212 | */ |
||
213 | public function renderTemplate(&$view) |
||
232 | } |
||
233 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: