From f3ba69c1d67c425ffa180d082a373e5cce0c86ce Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 14 Jan 2009 04:12:02 +0000 Subject: Make sure that helper functions are all static. Add new File_Structure_Test to make sure we don't regress. According to the PHP docs, the "public" keyword is implied on static functions, so remove it. Also, require private static functions to start with an _. http://php.net/manual/en/language.oop5.visibility.php --- core/helpers/message.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'core/helpers/message.php') diff --git a/core/helpers/message.php b/core/helpers/message.php index 482b6c1a..7fd62285 100644 --- a/core/helpers/message.php +++ b/core/helpers/message.php @@ -27,32 +27,32 @@ class message_Core { * Report a successful event. * @param string $msg a detailed message */ - public static function success($msg) { - self::add($msg, self::SUCCESS); + static function success($msg) { + self::_add($msg, self::SUCCESS); } /** * Report an informational event. * @param string $msg a detailed message */ - public static function info($msg) { - self::add($msg, self::INFO); + static function info($msg) { + self::_add($msg, self::INFO); } /** * Report that something went wrong, not fatal, but worth investigation. * @param string $msg a detailed message */ - public static function warning($msg) { - self::add($msg, self::WARNING); + static function warning($msg) { + self::_add($msg, self::WARNING); } /** * Report that something went wrong that should be fixed. * @param string $msg a detailed message */ - public static function error($msg) { - self::add($msg, self::ERROR); + static function error($msg) { + self::_add($msg, self::ERROR); } /** @@ -60,7 +60,7 @@ class message_Core { * @param string $msg a detailed message * @param integer $severity one of the severity constants */ - private function add($msg, $severity) { + private static function _add($msg, $severity) { $session = Session::instance(); $status = $session->get("messages"); $status[] = array($msg, $severity); @@ -73,7 +73,7 @@ class message_Core { * issues that need to be resolved. Transient ones are only displayed once. * @return html text */ - public function get() { + static function get() { $buf = array(); $messages = Session::instance()->get_once("messages", array()); @@ -90,7 +90,7 @@ class message_Core { * @param integer $severity * @return string */ - public function severity_class($severity) { + static function severity_class($severity) { switch($severity) { case self::SUCCESS: return "gSuccess"; -- cgit v1.2.3