Skip to content

Commit c802388

Browse files
authored
Prevented nesting array values (#347)
* Prevented nesting array values. * Revert change in the AudioObject.
1 parent d442cb7 commit c802388

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

src/Messages/MessageObjects/FileObject.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ public function toArray(): array
3333
];
3434

3535
if ($this->caption) {
36-
$returnArray[] = [
37-
'caption' => $this->caption
38-
];
36+
$returnArray['caption'] = $this->caption;
3937
}
4038

4139
return $returnArray;

src/Messages/MessageObjects/ImageObject.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ public function toArray(): array
3333
];
3434

3535
if ($this->caption) {
36-
$returnArray[] = [
37-
'caption' => $this->caption
38-
];
36+
$returnArray['caption'] = $this->caption;
3937
}
4038

4139
return $returnArray;

src/Messages/MessageObjects/VideoObject.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ public function toArray(): array
3333
];
3434

3535
if ($this->caption) {
36-
$returnArray[] = [
37-
'caption' => $this->caption
38-
];
36+
$returnArray['caption'] = $this->caption;
3937
}
4038

4139
return $returnArray;

0 commit comments

Comments
 (0)