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 = ResourceManager::E_ANALYZE; |
||
22 | /** Event for resources compiling */ |
||
23 | const E_RESOURCE_COMPILE = ResourceManager::E_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 types collection */ |
||
37 | const TYPES = [ |
||
38 | self::T_CSS, |
||
39 | self::T_LESS, |
||
40 | self::T_SCSS, |
||
41 | self::T_SASS, |
||
42 | self::T_JS, |
||
43 | self::T_TS, |
||
44 | self::T_COFFEE |
||
45 | ]; |
||
46 | |||
47 | /** Assets converter */ |
||
48 | const CONVERTER = [ |
||
49 | self::T_JS => self::T_JS, |
||
50 | self::T_TS => self::T_JS, |
||
51 | self::T_COFFEE => self::T_JS, |
||
52 | self::T_CSS => self::T_CSS, |
||
53 | self::T_LESS => self::T_CSS, |
||
54 | self::T_SCSS => self::T_CSS, |
||
55 | self::T_SASS => self::T_CSS, |
||
56 | ]; |
||
57 | |||
58 | /** @deprecated Identifier */ |
||
59 | protected $id = STATIC_RESOURCE_HANDLER; |
||
60 | |||
61 | /** Collection of registered resource types */ |
||
62 | protected $types = [ |
||
63 | self::T_CSS, |
||
64 | self::T_JS, |
||
65 | self::T_LESS, |
||
66 | self::T_SCSS, |
||
67 | self::T_SASS, |
||
68 | self::T_COFFEE, |
||
69 | self::T_TS |
||
70 | ]; |
||
71 | |||
72 | /** @var array Assets cache */ |
||
73 | protected $cache = []; |
||
74 | |||
75 | /** @var array Template markers for inserting assets */ |
||
76 | protected $templateMarkers = [ |
||
77 | 'css' => '</head>', |
||
78 | 'js' => '</body>' |
||
79 | ]; |
||
80 | /** @var array Collection of static resources */ |
||
81 | protected $resources = []; |
||
82 | |||
83 | /** @var array Collection of static resource URLs */ |
||
84 | protected $resourceUrls = []; |
||
85 | |||
86 | /** |
||
87 | * Module initialization stage. |
||
88 | * |
||
89 | * @see ModuleConnector::init() |
||
90 | * |
||
91 | * @param array $params Initialization parameters |
||
92 | * |
||
93 | * @return bool True if resource successfully initialized |
||
94 | */ |
||
95 | public function init(array $params = array()) |
||
119 | |||
120 | /** |
||
121 | * Get asset files from modules. |
||
122 | */ |
||
123 | private function getAssets() |
||
150 | |||
151 | /** |
||
152 | * Template rendering handler by injecting static assets url |
||
153 | * in appropriate. |
||
154 | * |
||
155 | * @param $view |
||
156 | * |
||
157 | * @return mixed |
||
158 | */ |
||
159 | public function renderTemplate(&$view) |
||
180 | |||
181 | /** |
||
182 | * Get cached asset URL. |
||
183 | * |
||
184 | * @param string $cachedAsset Full path to cached asset |
||
185 | * |
||
186 | * @return mixed Cached asset URL |
||
187 | */ |
||
188 | private function getAssetCachedUrl($cachedAsset) |
||
192 | } |
||
193 |
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: