Skip to content

Commit 8d8183a

Browse files
authored
Update WhatsAppFile.php (#511)
Avoiding Error Typed property Vonage\Messages\Channel\WhatsApp\WhatsAppFile::$context must not be accessed before initialization
1 parent fbffb95 commit 8d8183a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Messages/Channel/WhatsApp/WhatsAppFile.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,8 @@ public function toArray(): array
2626
{
2727
$returnArray = $this->getBaseMessageUniversalOutputArray();
2828
$returnArray['file'] = $this->fileObject->toArray();
29-
30-
if (!is_null($this->context)) {
31-
$returnArray['context'] = $this->context;
32-
}
29+
$returnArray['context'] = $this->context ?? null;
3330

3431
return $returnArray;
3532
}
36-
}
33+
}

0 commit comments

Comments
 (0)