1 | <?php |
||
17 | class UploadedFile implements UploadedFileInterface |
||
18 | { |
||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $clientFilename; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $clientMediaType; |
||
28 | |||
29 | /** |
||
30 | * @var int |
||
31 | */ |
||
32 | protected $error; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $file; |
||
38 | |||
39 | /** |
||
40 | * @var int |
||
41 | */ |
||
42 | protected $fileSize; |
||
43 | |||
44 | /** |
||
45 | * @var bool |
||
46 | */ |
||
47 | protected $moved = false; |
||
48 | |||
49 | /** |
||
50 | * @var StreamInterface |
||
51 | */ |
||
52 | protected $stream; |
||
53 | |||
54 | public function __construct( |
||
99 | |||
100 | /** |
||
101 | * {@inheritdoc} |
||
102 | * @throws \RuntimeException if the upload was not successful. |
||
103 | */ |
||
104 | public function getStream() |
||
122 | |||
123 | /** |
||
124 | * {@inheritdoc} |
||
125 | * |
||
126 | * @see http://php.net/is_uploaded_file |
||
127 | * @see http://php.net/move_uploaded_file |
||
128 | * |
||
129 | * @param string $targetPath Path to which to move the uploaded file. |
||
130 | * |
||
131 | * @throws \RuntimeException if the upload was not successful. |
||
132 | * @throws \InvalidArgumentException if the $path specified is invalid. |
||
133 | * @throws \RuntimeException on any error during the move operation, or on |
||
134 | * the second or subsequent call to the method. |
||
135 | */ |
||
136 | public function moveTo($targetPath) |
||
165 | |||
166 | /** |
||
167 | * {@inheritdoc} |
||
168 | */ |
||
169 | public function getSize() |
||
173 | |||
174 | /** |
||
175 | * {@inheritdoc} |
||
176 | * |
||
177 | * @see http://php.net/manual/en/features.file-upload.errors.php |
||
178 | * @return int One of PHP's UPLOAD_ERR_XXX constants. |
||
179 | */ |
||
180 | public function getError() |
||
184 | |||
185 | /** |
||
186 | * {@inheritdoc} |
||
187 | */ |
||
188 | public function getClientFilename() |
||
192 | |||
193 | /** |
||
194 | * {@inheritdoc} |
||
195 | */ |
||
196 | public function getClientMediaType() |
||
200 | } |
||
201 |