Conditions | 3 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 2 |
CRAP Score | 6.28 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
29 | 5 | public static function write($path, $content) |
|
30 | { |
||
31 | $path = Yii::getAlias($path); |
||
32 | if (!is_file($path) || file_get_contents($path) !== $content) { |
||
33 | static::mkdir(dirname($path)); |
||
34 | file_put_contents($path, $content); |
||
35 | Yii::warning('Written file: ' . $path, 'file'); |
||
36 | |||
37 | 5 | return true; |
|
38 | } |
||
39 | |||
40 | return false; |
||
41 | } |
||
42 | |||
63 |