| Total Complexity | 11 |
| Total Lines | 98 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 11 | trait FileTrait |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @ODM\Id() |
||
| 15 | */ |
||
| 16 | protected ?string $id = null; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @ODM\File\Filename() |
||
| 20 | */ |
||
| 21 | protected ?string $name = null; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @ODM\File\UploadDate(type="tz_date") |
||
| 25 | */ |
||
| 26 | protected ?DateTimeInterface $uploadDate = null; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @ODM\File\Length |
||
| 30 | */ |
||
| 31 | protected ?int $length = null; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @ODM\File\ChunkSize |
||
| 35 | */ |
||
| 36 | protected ?int $chunkSize = null; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @return string|null |
||
| 40 | */ |
||
| 41 | public function getId(): ?string |
||
| 44 | } |
||
| 45 | |||
| 46 | public function setId(string $id) |
||
| 47 | { |
||
| 48 | $this->id = $id; |
||
| 49 | return $this; |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @return string|null |
||
| 54 | */ |
||
| 55 | public function getName(): ?string |
||
| 58 | } |
||
| 59 | |||
| 60 | public function setName(string $name) |
||
| 61 | { |
||
| 62 | $this->name = $name; |
||
| 63 | return $this; |
||
| 64 | } |
||
| 65 | |||
| 66 | public function getUploadDate(): ?DateTimeInterface |
||
| 67 | { |
||
| 68 | return $this->uploadDate; |
||
| 69 | } |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @return int|null |
||
| 73 | */ |
||
| 74 | public function getLength(): ?int |
||
| 75 | { |
||
| 76 | return $this->length; |
||
| 77 | } |
||
| 78 | |||
| 79 | /** |
||
| 80 | * @return int|null |
||
| 81 | */ |
||
| 82 | public function getChunkSize(): ?int |
||
| 85 | } |
||
| 86 | |||
| 87 | /** |
||
| 88 | * Gets the length of file in GB, MB ot kB format |
||
| 89 | * |
||
| 90 | * @return string |
||
| 91 | */ |
||
| 92 | public function getPrettySize(): string |
||
| 109 | } |
||
| 110 | } |