| Total Complexity | 7 |
| Total Lines | 79 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class UploadFile |
||
| 17 | { |
||
| 18 | /** @var int|null */ |
||
| 19 | private $id; |
||
|
|
|||
| 20 | |||
| 21 | /** @var string */ |
||
| 22 | private $filename; |
||
| 23 | |||
| 24 | /** @var string */ |
||
| 25 | private $content_type; |
||
| 26 | |||
| 27 | /** @var string */ |
||
| 28 | private $content; |
||
| 29 | |||
| 30 | public function __construct(string $filename, string $contentType, string $content) |
||
| 31 | { |
||
| 32 | $this->setFilename($filename); |
||
| 33 | $this->setContentType($contentType); |
||
| 34 | $this->setContent($content); |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @return string |
||
| 39 | */ |
||
| 40 | public function getFilename(): string |
||
| 41 | { |
||
| 42 | return $this->filename; |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @param string $filename |
||
| 47 | * |
||
| 48 | * @return UploadFile |
||
| 49 | */ |
||
| 50 | public function setFilename(string $filename): UploadFile |
||
| 51 | { |
||
| 52 | $this->filename = $filename; |
||
| 53 | |||
| 54 | return $this; |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @return string |
||
| 59 | */ |
||
| 60 | public function getContentType(): string |
||
| 61 | { |
||
| 62 | return $this->content_type; |
||
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @param string $content_type |
||
| 67 | * |
||
| 68 | * @return UploadFile |
||
| 69 | */ |
||
| 70 | public function setContentType(string $content_type): UploadFile |
||
| 71 | { |
||
| 72 | $this->content_type = $content_type; |
||
| 73 | |||
| 74 | return $this; |
||
| 75 | } |
||
| 76 | |||
| 77 | /** |
||
| 78 | * @return string |
||
| 79 | */ |
||
| 80 | public function getContent(): string |
||
| 81 | { |
||
| 82 | return $this->content; |
||
| 83 | } |
||
| 84 | |||
| 85 | /** |
||
| 86 | * @param string $content |
||
| 87 | * |
||
| 88 | * @return UploadFile |
||
| 89 | */ |
||
| 90 | public function setContent(string $content): UploadFile |
||
| 95 | } |
||
| 96 | } |
||
| 97 |