Table.php 730 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * @package Grav\Console\TerminalObjects
  4. *
  5. * @copyright Copyright (C) 2015 - 2019 Trilby Media, LLC. All rights reserved.
  6. * @license MIT License; see LICENSE file for details.
  7. */
  8. namespace Grav\Console\TerminalObjects;
  9. class Table extends \League\CLImate\TerminalObject\Basic\Table
  10. {
  11. public function result()
  12. {
  13. $this->column_widths = $this->getColumnWidths();
  14. $this->table_width = $this->getWidth();
  15. $this->border = $this->getBorder();
  16. $this->buildHeaderRow();
  17. foreach ($this->data as $key => $columns) {
  18. $this->rows[] = $this->buildRow($columns);
  19. }
  20. $this->rows[] = $this->border;
  21. return $this->rows;
  22. }
  23. }