Completed
Push — tests ( bf6e7f...77e6ac )
by Alimzhan
31:02 queued 28:44
created
src/behaviors/FileBehavior.php 1 patch
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@
 block discarded – undo
8 8
 
9 9
 namespace nemmo\attachments\behaviors;
10 10
 
11
-use nemmo\attachments\models\File;
12 11
 use nemmo\attachments\ModuleTrait;
12
+use nemmo\attachments\models\File;
13 13
 use yii\base\Behavior;
14 14
 use yii\db\ActiveRecord;
15 15
 use yii\helpers\FileHelper;
Please login to merge, or discard this patch.
src/components/AttachmentsTable.php 1 patch
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,9 +2,9 @@
 block discarded – undo
2 2
 
3 3
 namespace nemmo\attachments\components;
4 4
 
5
-use nemmo\attachments\behaviors\FileBehavior;
6
-use nemmo\attachments\ModuleTrait;
7 5
 use Yii;
6
+use nemmo\attachments\ModuleTrait;
7
+use nemmo\attachments\behaviors\FileBehavior;
8 8
 use yii\bootstrap\Widget;
9 9
 use yii\data\ArrayDataProvider;
10 10
 use yii\db\ActiveRecord;
Please login to merge, or discard this patch.
src/components/AttachmentsTableWithPreview.php 1 patch
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,10 +2,10 @@
 block discarded – undo
2 2
 
3 3
 namespace nemmo\attachments\components;
4 4
 
5
+use Yii;
5 6
 use himiklab\colorbox\Colorbox;
6
-use nemmo\attachments\behaviors\FileBehavior;
7 7
 use nemmo\attachments\ModuleTrait;
8
-use Yii;
8
+use nemmo\attachments\behaviors\FileBehavior;
9 9
 use yii\bootstrap\Widget;
10 10
 use yii\data\ArrayDataProvider;
11 11
 use yii\db\ActiveRecord;
Please login to merge, or discard this patch.
src/controllers/FileController.php 1 patch
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,10 +2,10 @@
 block discarded – undo
2 2
 
3 3
 namespace nemmo\attachments\controllers;
4 4
 
5
+use Yii;
6
+use nemmo\attachments\ModuleTrait;
5 7
 use nemmo\attachments\models\File;
6 8
 use nemmo\attachments\models\UploadForm;
7
-use nemmo\attachments\ModuleTrait;
8
-use Yii;
9 9
 use yii\helpers\FileHelper;
10 10
 use yii\helpers\Url;
11 11
 use yii\web\Controller;
Please login to merge, or discard this patch.
src/Module.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -81,7 +81,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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();
Please login to merge, or discard this patch.