1 | <?php |
||
5 | class FileAPI extends Base |
||
6 | { |
||
7 | /** |
||
8 | * getOriginalName. |
||
9 | * |
||
10 | * @return string |
||
11 | */ |
||
12 | 3 | protected function getOriginalName($contentDisposition) |
|
13 | { |
||
14 | 3 | $originalName = $this->request->get('name'); |
|
15 | 3 | if (empty($originalName) === true) { |
|
16 | 3 | list($originalName) = sscanf( |
|
17 | 3 | $contentDisposition, |
|
18 | 'attachment; filename=%s' |
||
19 | 3 | ); |
|
20 | 3 | } |
|
21 | |||
22 | 3 | return preg_replace('/[\'"]/', '', $originalName); |
|
23 | } |
||
24 | |||
25 | /** |
||
26 | * getMimeType. |
||
27 | * |
||
28 | * @param string $originalName |
||
29 | * @return string |
||
30 | */ |
||
31 | 3 | protected function getMimeType($originalName) |
|
40 | |||
41 | /** |
||
42 | * receive. |
||
43 | * |
||
44 | * @param string $inputName |
||
45 | * @return \Symfony\Component\HttpFoundation\File\UploadedFile |
||
46 | * |
||
47 | * @throws \Recca0120\Upload\Exceptions\ChunkedResponseException |
||
48 | */ |
||
49 | 4 | protected function doReceive($inputName) |
|
73 | } |
||
74 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.