@@ -13,7 +13,6 @@ |
||
13 | 13 | use Application\Media; |
14 | 14 | use Bluz\Controller\Controller; |
15 | 15 | use Bluz\Controller\Mapper\Crud; |
16 | -use Bluz\Proxy\Config; |
|
17 | 16 | use Bluz\Proxy\Layout; |
18 | 17 | use Bluz\Proxy\Request; |
19 | 18 | use Bluz\Proxy\Response; |
@@ -11,7 +11,6 @@ |
||
11 | 11 | */ |
12 | 12 | namespace Application; |
13 | 13 | |
14 | -use Application\Media\Manager; |
|
15 | 14 | use Bluz\Application\Exception\BadRequestException; |
16 | 15 | use Bluz\Config\ConfigException; |
17 | 16 | use Bluz\Controller\Controller; |
@@ -26,7 +26,7 @@ |
||
26 | 26 | * @throws BadRequestException |
27 | 27 | * @throws ConfigException |
28 | 28 | */ |
29 | -return function () { |
|
29 | +return function() { |
|
30 | 30 | /** |
31 | 31 | * @var Controller $this |
32 | 32 | * @var UploadedFile $file |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | * @link https://github.com/bluzphp/skeleton |
5 | 5 | */ |
6 | 6 | |
7 | -declare(strict_types=1); |
|
7 | +declare(strict_types = 1); |
|
8 | 8 | |
9 | 9 | namespace Application\Media; |
10 | 10 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | throw new ConfigException('Upload path is not configured'); |
88 | 88 | } |
89 | 89 | |
90 | - $fullPath = PATH_PUBLIC .'/'. $uploadPath .'/'. $directory; |
|
90 | + $fullPath = PATH_PUBLIC.'/'.$uploadPath.'/'.$directory; |
|
91 | 91 | |
92 | 92 | if (!is_dir($fullPath) && !@mkdir($fullPath, 0755, true)) { |
93 | 93 | throw new ConfigException('Upload folder is not exists, please create it'); |
@@ -99,8 +99,8 @@ discard block |
||
99 | 99 | |
100 | 100 | $fileName = $this->getFileName($fullPath); |
101 | 101 | |
102 | - $this->publicPath = $uploadPath .'/'. $directory .'/'. $fileName; |
|
103 | - $this->uploadPath = $fullPath .'/'. $fileName; |
|
102 | + $this->publicPath = $uploadPath.'/'.$directory.'/'.$fileName; |
|
103 | + $this->uploadPath = $fullPath.'/'.$fileName; |
|
104 | 104 | |
105 | 105 | $this->file->moveTo($this->uploadPath); |
106 | 106 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | // If file already exists, increment name |
195 | 195 | $originFileName = $fileName; |
196 | 196 | $counter = 0; |
197 | - while (file_exists($path .'/'.$fileName.'.'.$fileExt)) { |
|
197 | + while (file_exists($path.'/'.$fileName.'.'.$fileExt)) { |
|
198 | 198 | $counter++; |
199 | 199 | $fileName = $originFileName.'-'.$counter; |
200 | 200 | } |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | * @link https://github.com/bluzphp/skeleton |
5 | 5 | */ |
6 | 6 | |
7 | -declare(strict_types=1); |
|
7 | +declare(strict_types = 1); |
|
8 | 8 | |
9 | 9 | namespace Application\Media; |
10 | 10 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $fileManager = new Manager($this, $file); |
99 | 99 | |
100 | 100 | // move request file |
101 | - $fileManager->moveToDir($this->userId .'/'. $this->module); |
|
101 | + $fileManager->moveToDir($this->userId.'/'.$this->module); |
|
102 | 102 | |
103 | 103 | // fill row data |
104 | 104 | $this->title = $this->title ?: pathinfo($file->getClientFilename(), PATHINFO_FILENAME); |
@@ -17,7 +17,7 @@ |
||
17 | 17 | /** |
18 | 18 | * @return array |
19 | 19 | */ |
20 | -return function () { |
|
20 | +return function() { |
|
21 | 21 | /** |
22 | 22 | * @var Controller $this |
23 | 23 | */ |