Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
41 | public function init() |
||
42 | { |
||
43 | parent::init(); |
||
44 | |||
45 | // /!\ CSS/LESS development only setting /!\ |
||
46 | // Touch the asset folder with the highest mtime of all contained files |
||
47 | // This will create a new folder in web/assets for every change and request |
||
48 | // made to the app assets. |
||
49 | if (getenv('APP_ASSET_FORCE_PUBLISH')) { |
||
50 | $path = \Yii::getAlias($this->sourcePath); |
||
51 | $files = FileHelper::findFiles($path); |
||
|
|||
52 | $mtimes = []; |
||
53 | foreach ($files as $file) { |
||
54 | $mtimes[] = filemtime($file); |
||
55 | } |
||
56 | touch($path, max($mtimes)); |
||
57 | } |
||
58 | } |
||
59 | } |
||
60 |
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.