Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
JPustkuchen committed May 10, 2021
1 parent 519037c commit c4a0276
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Elements/TableRow.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ public function iterateCells(callable $lambda) {
public function toArray(): array {
$result = [
'cells' => [], // Filled below.
'cellsByKey' => [], // Filled below.
'attributes' => $this->getAttributes()->toString(),
];

Expand All @@ -189,6 +190,12 @@ public function toArray(): array {
}
}

if (!empty($this->cellsByKey)) {
foreach ($this->cellsByKey as $key => $cell) {
$result['cellsByKey'][$key] = $cell->toArray();
}
}

return $result;
}
}

0 comments on commit c4a0276

Please sign in to comment.