From 91cd673ce5b9cb8b3e58e7f1a4e698958b7d30ce Mon Sep 17 00:00:00 2001 From: James Date: Tue, 13 Dec 2011 22:54:51 +0000 Subject: [PATCH] Nice error if no data found --- src/CreepyCoder.php | 1 + src/DataManager.php | 1 + 2 files changed, 2 insertions(+) diff --git a/src/CreepyCoder.php b/src/CreepyCoder.php index 9936897..85ad809 100644 --- a/src/CreepyCoder.php +++ b/src/CreepyCoder.php @@ -51,6 +51,7 @@ #print_r($dataManager->getData()); #print(count($dataManager->getData())); +if (!$dataManager->hasData()) die("No data found!\n"); #################################### output diff --git a/src/DataManager.php b/src/DataManager.php index fa3144f..952dca9 100644 --- a/src/DataManager.php +++ b/src/DataManager.php @@ -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) {