1 | <?php |
||
32 | trait IncludeTrait |
||
33 | { |
||
34 | |||
35 | /** |
||
36 | * Include array paths. |
||
37 | * |
||
38 | * @param array|string $path |
||
39 | * @param array $options |
||
40 | * @param string $type |
||
41 | * @return bool|null|string |
||
42 | */ |
||
43 | protected function _arrayInclude($path, array $options = [], $type = 'css') |
||
61 | |||
62 | /** |
||
63 | * Get current asset type. |
||
64 | * |
||
65 | * @param string $type |
||
66 | * @return string |
||
67 | */ |
||
68 | protected function _getAssetType($type = 'css') |
||
72 | |||
73 | /** |
||
74 | * Get current css output. |
||
75 | * |
||
76 | * @param array $options |
||
77 | * @param string $url |
||
78 | * @return string |
||
79 | */ |
||
80 | protected function _getCssOutput(array $options, $url) |
||
95 | |||
96 | /** |
||
97 | * Get current asset path. |
||
98 | * |
||
99 | * @param string|array $path |
||
100 | * @param string|array $assetArray |
||
101 | * @return string |
||
102 | */ |
||
103 | protected function _getCurrentPath($path, $assetArray) |
||
107 | |||
108 | /** |
||
109 | * Get current options and url asset. |
||
110 | * |
||
111 | * @param string $path |
||
112 | * @param array $options |
||
113 | * @param string $type |
||
114 | * @param bool $external |
||
115 | * @return array |
||
116 | */ |
||
117 | protected function _getCurrentUrlAndOptions($path, array $options, $type, $external) |
||
130 | |||
131 | /** |
||
132 | * Get current script output. |
||
133 | * |
||
134 | * @param array $options |
||
135 | * @param string $url |
||
136 | * @return string |
||
137 | */ |
||
138 | protected function _getScriptOutput(array $options, $url) |
||
145 | |||
146 | /** |
||
147 | * Get current output by type. |
||
148 | * |
||
149 | * @param array $options |
||
150 | * @param string $url |
||
151 | * @param string $type |
||
152 | * @return string |
||
153 | */ |
||
154 | protected function _getTypeOutput(array $options, $url, $type) |
||
163 | |||
164 | /** |
||
165 | * Check has asset. |
||
166 | * |
||
167 | * @param string $path |
||
168 | * @param string $type |
||
169 | * @param bool $external |
||
170 | * @return bool |
||
171 | */ |
||
172 | protected function _hasAsset($path, $type, $external) |
||
176 | |||
177 | /** |
||
178 | * Include asset. |
||
179 | * |
||
180 | * @param string|array $path |
||
181 | * @param array $options |
||
182 | * @param string $type |
||
183 | * @return bool|null|string |
||
184 | */ |
||
185 | protected function _include($path, array $options = [], $type = 'css') |
||
232 | |||
233 | /** |
||
234 | * Check asset on once include. |
||
235 | * |
||
236 | * @param string $path |
||
237 | * @param string $type |
||
238 | * @param array $options |
||
239 | * @return bool |
||
240 | */ |
||
241 | protected function _isOnceIncluded($path, $type, array $options = []) |
||
245 | |||
246 | /** |
||
247 | * Setup default fetch block if option block is true. |
||
248 | * |
||
249 | * @param array $options |
||
250 | * @param string $block |
||
251 | * @return array |
||
252 | */ |
||
253 | protected function _setFetchBlock(array $options, $block) |
||
261 | } |
||
262 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.