summaryrefslogtreecommitdiff
path: root/core/helpers/message.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-01-14 04:12:02 +0000
committerBharat Mediratta <bharat@menalto.com>2009-01-14 04:12:02 +0000
commitf3ba69c1d67c425ffa180d082a373e5cce0c86ce (patch)
tree5ecbbe0ba96a94e3f4aadd26042c8ad1a32ef1bc /core/helpers/message.php
parent02af2d8b7639fdc18fba3d69a4ca0a3f5c92b948 (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/message.php')
-rw-r--r--core/helpers/message.php22
1 files changed, 11 insertions, 11 deletions
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";