From 8ea0d909520a33d95a96126683836e322ff39df5 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Thu, 11 Mar 2010 20:49:32 -0500 Subject: [PATCH] Removed Error Class * Switching to Exceptions across the framework --- classes/Error.php | 111 ---------------------------------------------- 1 file changed, 111 deletions(-) delete mode 100644 classes/Error.php diff --git a/classes/Error.php b/classes/Error.php deleted file mode 100644 index 914e80b..0000000 --- a/classes/Error.php +++ /dev/null @@ -1,111 +0,0 @@ -. - * - * @author Joshua John Sherman - * @copyright Copyright 2007, 2008, 2009 Joshua John Sherman - * @link http://phpwithpickles.org - * @license http://www.gnu.org/copyleft/lesser.html - * @package PICKLES - */ - -/** - * Error handling class - * - * Handles (for the most part) all the errors and warnings that - * are encountered by the PICKLES core classes. Usage is optional - * for site level code. Errors are logged but it's up to the - * developer to interact with and/or display the errors to their - * end-users. - */ -class Error extends Object { - - /** - * Private message arrays - */ - private $errors = null; - private $warnings = null; - - /** - * Adds an error message - * - * @param string Error message - * @return boolean true - */ - public function addError($message) { - $this->errors[] = $message; - Logger::write('error', '[error] ' . $message); - return true; - } - - /** - * Adds a warning message - * - * @param string Warning message - * @return boolean true - */ - public function addWarning($message) { - $this->warnings[] = $message; - Logger::write('error', '[warning] ' . $message); - return true; - } - - /** - * Gets the stored errors - * - * @return mixed Messages in sequential order or false - */ - public function getErrors() { - return $this->errors; - } - - /** - * Resets the stored errors - * - * @return boolean true - */ - public function resetErrors() { - $this->errors = null; - return true; - } - - /** - * Gets the stored warnings - * - * @return array Warning messages indexed by the order they were stored - */ - public function getWarnings() { - return $this->warnings; - } - - /** - * Determines if there are any stored errors or warnings - * - * @return boolean Whether or not there are any errors or warnings. - * @todo Rename this to something like hasError()... not sure why I called it isError() - */ - public function isError() { - if (isset($this->errors) || isset($this->warnings)) { - return true; - } - - return false; - } -} - -?>