Total Complexity | 7 |
Total Lines | 53 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
8 | class UploadedFileInfo |
||
9 | { |
||
10 | private string $contentType; |
||
11 | private string $name; |
||
12 | private string $tmpFile; |
||
13 | |||
14 | public function __construct( |
||
15 | string $name, |
||
16 | string $contentType, |
||
17 | string $tmpFile |
||
18 | ) |
||
19 | { |
||
20 | $this->contentType = $contentType; |
||
21 | $this->name = $name; |
||
22 | $this->tmpFile = $tmpFile; |
||
23 | } |
||
24 | |||
25 | public static function fromArray(array $data) |
||
26 | { |
||
27 | return new self($data['name'], $data['type'], $data['tmp_name']); |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * @return string |
||
32 | */ |
||
33 | public function getContentType(): string |
||
34 | { |
||
35 | return $this->contentType; |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * @return string |
||
40 | */ |
||
41 | public function getName(): string |
||
42 | { |
||
43 | return $this->name; |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * @return string |
||
48 | */ |
||
49 | public function getTmpFile(): string |
||
50 | { |
||
51 | return $this->tmpFile; |
||
52 | } |
||
53 | |||
54 | public function getImageFormat(): ?string |
||
61 | } |
||
62 | } |