diff --git a/src/TableWriter.php b/src/TableWriter.php index c1399e0..c3cb0c5 100644 --- a/src/TableWriter.php +++ b/src/TableWriter.php @@ -46,10 +46,15 @@ public function writeItem(array $item) { /** * {@inheritdoc} */ - public function finish() { - $this->table->setHeaders(array_keys($this->firstItem)); - $this->table->render(); - + public function finish() { + if(!is_null($this->firstItem)) { + $this->table->setHeaders(array_keys($this->firstItem)); + }else{ + $this->table->setHeaders(array('Result')); + $this->table->addRow(array('No items processed.')); + } + + $this->table->render(); $this->firstItem = null; } }