diff options
author | robocoder <anthon.pang@gmail.com> | 2010-10-28 22:21:55 +0400 |
---|---|---|
committer | robocoder <anthon.pang@gmail.com> | 2010-10-28 22:21:55 +0400 |
commit | 5a02ef6b6a66e47796a2a111918f613f13341fae (patch) | |
tree | cbf975c77a8f435d959697dd01c2feee28c1f742 /core/Menu | |
parent | 7e11ec5205bacdba2d01faa10b8779a4bcbdbc38 (diff) |
peephole optimization to singletons, i.e., new self vs. $c = __CLASS__; new $c
git-svn-id: http://dev.piwik.org/svn/trunk@3270 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/Menu')
-rw-r--r-- | core/Menu/Admin.php | 5 | ||||
-rw-r--r-- | core/Menu/Main.php | 5 | ||||
-rw-r--r-- | core/Menu/Top.php | 5 |
3 files changed, 6 insertions, 9 deletions
diff --git a/core/Menu/Admin.php b/core/Menu/Admin.php index d06db2d1cd..3fc545400b 100644 --- a/core/Menu/Admin.php +++ b/core/Menu/Admin.php @@ -22,9 +22,8 @@ class Piwik_Menu_Admin extends Piwik_Menu_Abstract static public function getInstance() { if (self::$instance == null) - { - $c = __CLASS__; - self::$instance = new $c(); + { + self::$instance = new self; } return self::$instance; } diff --git a/core/Menu/Main.php b/core/Menu/Main.php index c2260ae7ec..bffb4bb6dc 100644 --- a/core/Menu/Main.php +++ b/core/Menu/Main.php @@ -23,9 +23,8 @@ class Piwik_Menu_Main extends Piwik_Menu_Abstract static public function getInstance() { if (self::$instance == null) - { - $c = get_class(); - self::$instance = new $c(); + { + self::$instance = new self; } return self::$instance; } diff --git a/core/Menu/Top.php b/core/Menu/Top.php index 2a023d77ff..59cc123b1b 100644 --- a/core/Menu/Top.php +++ b/core/Menu/Top.php @@ -22,9 +22,8 @@ class Piwik_Menu_Top extends Piwik_Menu_Abstract static public function getInstance() { if (self::$instance == null) - { - $c = __CLASS__; - self::$instance = new $c(); + { + self::$instance = new self; } return self::$instance; } |