summaryrefslogtreecommitdiff
path: root/core/helpers/site_status.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/site_status.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/site_status.php')
-rw-r--r--core/helpers/site_status.php24
1 files changed, 12 insertions, 12 deletions
diff --git a/core/helpers/site_status.php b/core/helpers/site_status.php
index eb9abb6b..4b465e45 100644
--- a/core/helpers/site_status.php
+++ b/core/helpers/site_status.php
@@ -28,8 +28,8 @@ class site_status_Core {
* @param string $msg a detailed message
* @param string $permanent_key make this message permanent and store it under this key
*/
- public static function success($msg, $permanent_key) {
- self::add($msg, self::SUCCESS, $permanent_key);
+ static function success($msg, $permanent_key) {
+ self::_add($msg, self::SUCCESS, $permanent_key);
}
/**
@@ -37,8 +37,8 @@ class site_status_Core {
* @param string $msg a detailed message
* @param string $permanent_key make this message permanent and store it under this key
*/
- public static function info($msg, $permanent_key) {
- self::add($msg, self::INFO, $permanent_key);
+ static function info($msg, $permanent_key) {
+ self::_add($msg, self::INFO, $permanent_key);
}
/**
@@ -46,8 +46,8 @@ class site_status_Core {
* @param string $msg a detailed message
* @param string $permanent_key make this message permanent and store it under this key
*/
- public static function warning($msg, $permanent_key) {
- self::add($msg, self::WARNING, $permanent_key);
+ static function warning($msg, $permanent_key) {
+ self::_add($msg, self::WARNING, $permanent_key);
}
/**
@@ -55,8 +55,8 @@ class site_status_Core {
* @param string $msg a detailed message
* @param string $permanent_key make this message permanent and store it under this key
*/
- public static function error($msg, $permanent_key) {
- self::add($msg, self::ERROR, $permanent_key);
+ static function error($msg, $permanent_key) {
+ self::_add($msg, self::ERROR, $permanent_key);
}
/**
@@ -65,7 +65,7 @@ class site_status_Core {
* @param integer $severity one of the severity constants
* @param string $permanent_key make this message permanent and store it under this key
*/
- private function add($msg, $severity, $permanent_key) {
+ private static function _add($msg, $severity, $permanent_key) {
$message = ORM::factory("message")
->where("key", $permanent_key)
->find();
@@ -81,7 +81,7 @@ class site_status_Core {
* Remove any permanent message by key.
* @param string $permanent_key
*/
- public function clear($permanent_key) {
+ static function clear($permanent_key) {
$message = ORM::factory("message")->where("key", $permanent_key)->find();
if ($message->loaded) {
$message->delete();
@@ -94,7 +94,7 @@ class site_status_Core {
* issues that need to be resolved. Transient ones are only displayed once.
* @return html text
*/
- public function get() {
+ static function get() {
if (!user::active()->admin) {
return;
}
@@ -114,7 +114,7 @@ class site_status_Core {
* @param integer $severity
* @return string
*/
- public function severity_class($severity) {
+ static function severity_class($severity) {
switch($severity) {
case self::SUCCESS:
return "gSuccess";