1 | <?php |
||
26 | class Manager |
||
27 | { |
||
28 | const THUMB_HEIGHT = 196; |
||
29 | const THUMB_WIDTH = 196; |
||
30 | |||
31 | /** |
||
32 | * @var Row |
||
33 | */ |
||
34 | protected $media; |
||
35 | |||
36 | /** |
||
37 | * @var UploadedFile |
||
38 | */ |
||
39 | protected $file; |
||
40 | |||
41 | /** |
||
42 | * @var string |
||
43 | */ |
||
44 | protected $name; |
||
45 | |||
46 | /** |
||
47 | * @var string |
||
48 | */ |
||
49 | protected $publicPath; |
||
50 | |||
51 | /** |
||
52 | * @var string |
||
53 | */ |
||
54 | protected $uploadPath; |
||
55 | |||
56 | /** |
||
57 | * @param Row $media |
||
58 | * @param UploadedFile $file |
||
59 | * |
||
60 | */ |
||
61 | public function __construct($media, $file) |
||
73 | |||
74 | /** |
||
75 | * Move file to directory |
||
76 | * |
||
77 | * @param string $directory |
||
78 | * |
||
79 | * @return void |
||
80 | * @throws ConfigException |
||
81 | */ |
||
82 | public function moveToDir($directory) |
||
107 | |||
108 | /** |
||
109 | * Create thumbnail |
||
110 | * |
||
111 | * @return string |
||
112 | */ |
||
113 | public function createThumbnail() |
||
124 | |||
125 | /** |
||
126 | * Check Error code |
||
127 | * |
||
128 | * @return void |
||
129 | * @throws BadRequestException |
||
130 | */ |
||
131 | protected function checkError() |
||
151 | |||
152 | /** |
||
153 | * checkType |
||
154 | * |
||
155 | * @return void |
||
156 | * @throws BadRequestException |
||
157 | */ |
||
158 | protected function checkType() |
||
167 | |||
168 | /** |
||
169 | * Prepare File name for path |
||
170 | * |
||
171 | * @param string $path |
||
172 | * |
||
173 | * @return string |
||
174 | */ |
||
175 | protected function getFileName($path) : string |
||
203 | |||
204 | /** |
||
205 | * @return string |
||
206 | */ |
||
207 | public function getPublicPath(): string |
||
211 | |||
212 | /** |
||
213 | * @return string |
||
214 | */ |
||
215 | public function getUploadPath(): string |
||
219 | } |
||
220 |
As per the PSR-2 coding standard, case statements should not be wrapped in curly braces. There is no need for braces, since each case is terminated by the next
break
.There is also the option to use a semicolon instead of a colon, this is discouraged because many programmers do not even know it works and the colon is universal between programming languages.
To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.