*/ public array $bbox; /** * Cells in this row, ordered left-to-right * * @var array */ public array $cells; /** * Whether this row is a header row * * Header rows are typically repeated when tables span multiple pages. */ public bool $is_header; /** * Create Row from JSON array * * @param array $data JSON data * @return self */ public static function fromArray(array $data): self { $row = new self(); $row->bbox = $data['bbox']; $row->is_header = $data['is_header']; foreach ($data['cells'] ?? [] as $item) { $row->cells[] = Cell::fromArray($item); } return $row; } /** * Convert to JSON array * * @return array */ public function toArray(): array { return [ 'bbox' => $this->bbox, 'cells' => array_map(fn($c) => $c->toArray(), $this->cells), 'is_header' => $this->is_header, ]; } }