Skip to content

Commit

Permalink
Merge pull request #4 from gilbite/countable
Browse files Browse the repository at this point in the history
fix some minor bugs that `count()` non-countable values
  • Loading branch information
travail committed Nov 1, 2019
2 parents 09f516f + fc8d60f commit d55abb9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/SimpleTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function __construct()

// Padding
foreach ($cache as $col) {
while ($col[2] < $max) {
while (count($col[2]) < $max) {
array_push($col[2], '');
}
}
Expand Down Expand Up @@ -141,7 +141,7 @@ public function draw()

$title = 0;
foreach ($this->columns as $column) {
if ($title < count($column[0])) $title = count($column[2]);
if ($title < count($column[2])) $title = count($column[2]);
}

if ($title) {
Expand Down Expand Up @@ -263,7 +263,7 @@ public function row()
// Shortcut
if ($size < 0) return $this;

for ($i = 0; $i < count($size) + 1; $i++) {
for ($i = 0; $i < $size + 1; $i++) {
if ($size <= count($texts)) break;
array_push($texts, '');
}
Expand Down

0 comments on commit d55abb9

Please sign in to comment.