Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
count() optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik authored and michalbundyra committed Oct 16, 2019
1 parent 633c604 commit 7189079
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Table/Row.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function render(array $columnWidths, Decorator $decorator, $padding = 0)

// If there is no single column, create a column which spans over the
// entire row
if (count($this->columns) === 0) {
if (! $this->columns) {
$this->appendColumn(new Column(null, null, count($columnWidths)));
}

Expand Down
4 changes: 2 additions & 2 deletions src/Table/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function setOptions(array $options)
*/
public function setColumnWidths(array $columnWidths)
{
if (count($columnWidths) === 0) {
if (! $columnWidths) {
throw new Exception\InvalidArgumentException('You must supply at least one column');
}

Expand Down Expand Up @@ -342,7 +342,7 @@ public function appendRow($row)
public function render()
{
// There should be at least one row
if (count($this->rows) === 0) {
if (! $this->rows) {
throw new Exception\UnexpectedValueException('No rows were added to the table yet');
}

Expand Down

0 comments on commit 7189079

Please sign in to comment.