From f861604e6c88ee73aef48d2fc5cf195b9f1a5dc6 Mon Sep 17 00:00:00 2001 From: David mattei Date: Mon, 5 Dec 2022 11:48:16 +0100 Subject: [PATCH] fix(core): Upload asset $status accessed before initialization (#156) --- EMS/core-bundle/src/Entity/UploadedAsset.php | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/EMS/core-bundle/src/Entity/UploadedAsset.php b/EMS/core-bundle/src/Entity/UploadedAsset.php index 73930334d..33f80a7ff 100644 --- a/EMS/core-bundle/src/Entity/UploadedAsset.php +++ b/EMS/core-bundle/src/Entity/UploadedAsset.php @@ -26,7 +26,7 @@ class UploadedAsset implements EntityInterface /** * @ORM\Column(name="status", type="string", length=64, nullable=true) */ - private string $status; + private ?string $status = null; /** * @ORM\Column(name="sha1", type="string", length=128) @@ -96,7 +96,7 @@ public function __construct() } /** - * @return array{sha1:string, type:string, available:bool, name:string, size:int, status:string, uploaded:int, user:string} + * @return array{sha1:string, type:string, available:bool, name:string, size:int, status: ?string, uploaded:int, user:string} */ public function getResponse(): array { @@ -122,26 +122,14 @@ public function getId() return $this->id; } - /** - * Set status. - * - * @param string $status - * - * @return UploadedAsset - */ - public function setStatus($status) + public function setStatus(?string $status): self { $this->status = $status; return $this; } - /** - * Get status. - * - * @return string - */ - public function getStatus() + public function getStatus(): ?string { return $this->status; }