diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-01-14 04:12:02 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-01-14 04:12:02 +0000 |
commit | f3ba69c1d67c425ffa180d082a373e5cce0c86ce (patch) | |
tree | 5ecbbe0ba96a94e3f4aadd26042c8ad1a32ef1bc /core/helpers/log.php | |
parent | 02af2d8b7639fdc18fba3d69a4ca0a3f5c92b948 (diff) |
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
Diffstat (limited to 'core/helpers/log.php')
-rw-r--r-- | core/helpers/log.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/core/helpers/log.php b/core/helpers/log.php index 4b135465..181efaa9 100644 --- a/core/helpers/log.php +++ b/core/helpers/log.php @@ -29,8 +29,8 @@ class log_Core { * @param string $message a detailed log message * @param string $html an html snippet presented alongside the log message to aid the admin */ - public static function success($category, $message, $html="") { - self::add($category, $message, $html, self::SUCCESS); + static function success($category, $message, $html="") { + self::_add($category, $message, $html, self::SUCCESS); } /** @@ -39,8 +39,8 @@ class log_Core { * @param string $message a detailed log message * @param string $html an html snippet presented alongside the log message to aid the admin */ - public static function info($category, $message, $html="") { - self::add($category, $message, $html, self::INFO); + static function info($category, $message, $html="") { + self::_add($category, $message, $html, self::INFO); } /** @@ -49,8 +49,8 @@ class log_Core { * @param string $message a detailed log message * @param string $html an html snippet presented alongside the log message to aid the admin */ - public static function warning($category, $message, $html="") { - self::add($category, $message, $html, self::WARNING); + static function warning($category, $message, $html="") { + self::_add($category, $message, $html, self::WARNING); } /** @@ -59,8 +59,8 @@ class log_Core { * @param string $message a detailed log message * @param string $html an html snippet presented alongside the log message to aid the admin */ - public static function error($category, $message, $html="") { - self::add($category, $message, $html, self::ERROR); + static function error($category, $message, $html="") { + self::_add($category, $message, $html, self::ERROR); } /** @@ -71,7 +71,7 @@ class log_Core { * @param integer $severity INFO, WARNING or ERROR * @param string $html an html snippet presented alongside the log message to aid the admin */ - private static function add($category, $message, $html, $severity) { + private static function _add($category, $message, $html, $severity) { $log = ORM::factory("log"); $log->category = $category; $log->message = $message; @@ -92,7 +92,7 @@ class log_Core { * @param integer $severity * @return string */ - public function severity_class($severity) { + static function severity_class($severity) { switch($severity) { case self::SUCCESS: return "gSuccess"; |