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 --- modules/comment/helpers/comment_block.php | 4 ++-- modules/comment/helpers/comment_dashboard.php | 4 ++-- modules/comment/helpers/comment_installer.php | 4 ++-- modules/comment/helpers/comment_menu.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'modules/comment/helpers') diff --git a/modules/comment/helpers/comment_block.php b/modules/comment/helpers/comment_block.php index f24f19b1..d8f08feb 100644 --- a/modules/comment/helpers/comment_block.php +++ b/modules/comment/helpers/comment_block.php @@ -18,12 +18,12 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class comment_block_Core { - public static function head($theme) { + static function head($theme) { $url = url::file("modules/comment/js/comment.js"); return "\n"; } - public static function photo_bottom($theme) { + static function photo_bottom($theme) { $block = new Block; $block->css_id = "gComments"; $block->title = t("Comments"); diff --git a/modules/comment/helpers/comment_dashboard.php b/modules/comment/helpers/comment_dashboard.php index 7edee2f5..984c4cea 100644 --- a/modules/comment/helpers/comment_dashboard.php +++ b/modules/comment/helpers/comment_dashboard.php @@ -18,11 +18,11 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class comment_dashboard_Core { - public static function get_list() { + static function get_list() { return array("recent_comments" => t("Recent Comments")); } - public static function get_block($block_id) { + static function get_block($block_id) { $block = new Block(); switch ($block_id) { case "recent_comments": diff --git a/modules/comment/helpers/comment_installer.php b/modules/comment/helpers/comment_installer.php index 34968cb0..aba32566 100644 --- a/modules/comment/helpers/comment_installer.php +++ b/modules/comment/helpers/comment_installer.php @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class comment_installer { - public static function install() { + static function install() { $db = Database::instance(); $version = module::get_version("comment"); @@ -56,7 +56,7 @@ class comment_installer { } } - public static function uninstall() { + static function uninstall() { $db = Database::instance(); $db->query("DROP TABLE IF EXISTS `comments`;"); module::delete("comment"); diff --git a/modules/comment/helpers/comment_menu.php b/modules/comment/helpers/comment_menu.php index 9df3024a..2a2a578c 100644 --- a/modules/comment/helpers/comment_menu.php +++ b/modules/comment/helpers/comment_menu.php @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class comment_menu_Core { - public static function admin($menu, $theme) { + static function admin($menu, $theme) { $menu->get("content_menu") ->append(Menu::factory("link") ->id("comments") @@ -26,7 +26,7 @@ class comment_menu_Core { ->url(url::site("admin/comments"))); } - public static function photo($menu, $theme) { + static function photo($menu, $theme) { $menu ->append(Menu::factory("link") ->id("comments") -- cgit v1.2.3