Skip to content

Commit

Permalink
Nice error if no data found
Browse files Browse the repository at this point in the history
  • Loading branch information
jarofgreen committed Dec 13, 2011
1 parent 1a8e702 commit 91cd673
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/CreepyCoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#print_r($dataManager->getData());
#print(count($dataManager->getData()));

if (!$dataManager->hasData()) die("No data found!\n");

#################################### output

Expand Down
1 change: 1 addition & 0 deletions src/DataManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function addData(CoderAction $action) {
}

public function getData() { return $this->data; }
public function hasData() { return count($this->data) > 0; }

/** takes a writer and runs it immediately - no waiting list **/
public function writeData(BaseWriteClass $writer) {
Expand Down

0 comments on commit 91cd673

Please sign in to comment.