@@ -44,6 +44,10 @@ discard block |
||
44 | 44 | ]; |
45 | 45 | } |
46 | 46 | |
47 | + /** |
|
48 | + * @param string $category |
|
49 | + * @param string $message |
|
50 | + */ |
|
47 | 51 | public static function t($category, $message, $params = [], $language = null) |
48 | 52 | { |
49 | 53 | return \Yii::t('nemmo/' . $category, $message, $params, $language); |
@@ -109,7 +113,7 @@ discard block |
||
109 | 113 | |
110 | 114 | /** |
111 | 115 | * @param $filePath string |
112 | - * @param $owner |
|
116 | + * @param \yii\base\Component $owner |
|
113 | 117 | * @return bool|File |
114 | 118 | * @throws \Exception |
115 | 119 | * @throws \yii\base\InvalidConfigException |
@@ -81,7 +81,9 @@ discard block |
||
81 | 81 | for ($i = 0; $i < $depth; $i++) { |
82 | 82 | $folder = substr($fileHash, $i * 3, 2); |
83 | 83 | $path .= $folder; |
84 | - if ($i != $depth - 1) $path .= DIRECTORY_SEPARATOR; |
|
84 | + if ($i != $depth - 1) { |
|
85 | + $path .= DIRECTORY_SEPARATOR; |
|
86 | + } |
|
85 | 87 | } |
86 | 88 | |
87 | 89 | return $path; |
@@ -167,7 +169,9 @@ discard block |
||
167 | 169 | { |
168 | 170 | /** @var File $file */ |
169 | 171 | $file = File::findOne(['id' => $id]); |
170 | - if (empty($file)) return false; |
|
172 | + if (empty($file)) { |
|
173 | + return false; |
|
174 | + } |
|
171 | 175 | $filePath = $this->getFilesDirPath($file->hash) . DIRECTORY_SEPARATOR . $file->hash . '.' . $file->type; |
172 | 176 | |
173 | 177 | return unlink($filePath) && $file->delete(); |