Commit a6eec17e authored by Ghislain Loas's avatar Ghislain Loas
Browse files

HelperBroker statics call statically, and prey

parent 6333c15e
......@@ -76,7 +76,7 @@ class Zend_Controller_Action_HelperBroker
*/
static public function addHelper(Zend_Controller_Action_Helper_Abstract $helper)
{
self::getStack()->push($helper);
static::getStack()->push($helper);
return;
}
......@@ -89,7 +89,7 @@ class Zend_Controller_Action_HelperBroker
{
$prefix = rtrim($prefix, '_');
$path = str_replace('_', DIRECTORY_SEPARATOR, $prefix);
self::addPath($path, $prefix);
static::addPath($path, $prefix);
return;
}
......@@ -100,7 +100,7 @@ class Zend_Controller_Action_HelperBroker
*/
static public function resetHelpers()
{
self::$_stack = null;
static::$_stack = null;
return;
}
......@@ -124,7 +124,7 @@ class Zend_Controller_Action_HelperBroker
$info['dir'] = $path;
$info['prefix'] = $prefix;
self::$_paths[] = $info;
static::$_paths[] = $info;
return;
}
......@@ -137,7 +137,7 @@ class Zend_Controller_Action_HelperBroker
public function __construct(Zend_Controller_Action $actionController)
{
$this->_actionController = $actionController;
foreach (self::getStack() as $helper) {
foreach (static::getStack() as $helper) {
$helper->setActionController($actionController);
$helper->init();
}
......@@ -150,7 +150,7 @@ class Zend_Controller_Action_HelperBroker
*/
public function notifyPreDispatch()
{
foreach (self::getStack() as $helper) {
foreach (static::getStack() as $helper) {
$helper->preDispatch();
}
}
......@@ -162,7 +162,7 @@ class Zend_Controller_Action_HelperBroker
*/
public function notifyPostDispatch()
{
foreach (self::getStack() as $helper) {
foreach (static::getStack() as $helper) {
$helper->postDispatch();
}
}
......@@ -190,12 +190,12 @@ class Zend_Controller_Action_HelperBroker
*/
public function getHelper($name)
{
$name = self::_normalizeHelperName($name);
$name = static::_normalizeHelperName($name);
$stack = static::getStack();
$stack = self::getStack();
if (!isset($stack->{$name})) {
self::_loadHelper($name);
static::_loadHelper($name);
}
$helper = $stack->{$name};
......@@ -227,12 +227,12 @@ class Zend_Controller_Action_HelperBroker
*/
public static function getStaticHelper($name)
{
$name = self::_normalizeHelperName($name);
$name = static::_normalizeHelperName($name);
$stack = static::getStack();
$stack = self::getStack();
if (!isset($stack->{$name})) {
self::_loadHelper($name);
static::_loadHelper($name);
}
$helper = $stack->{$name};
......@@ -257,10 +257,10 @@ class Zend_Controller_Action_HelperBroker
*/
public static function getExistingHelper($name)
{
$name = self::_normalizeHelperName($name);
$name = static::_normalizeHelperName($name);
$stack = static::getStack();
$stack = self::getStack();
if (isset($stack->{$name})) {
return $stack->{$name};
}
......@@ -275,7 +275,7 @@ class Zend_Controller_Action_HelperBroker
*/
public static function getExistingHelpers()
{
return self::getStack()->getHelpersByName();
return static::getStack()->getHelpersByName();
}
/**
......@@ -286,8 +286,8 @@ class Zend_Controller_Action_HelperBroker
*/
public static function hasHelper($name)
{
$name = self::_normalizeHelperName($name);
return isset(self::getStack()->{$name});
$name = static::_normalizeHelperName($name);
return isset(static::getStack()->{$name});
}
/**
......@@ -298,8 +298,8 @@ class Zend_Controller_Action_HelperBroker
*/
public static function removeHelper($name)
{
$name = self::_normalizeHelperName($name);
$stack = self::getStack();
$name = static::_normalizeHelperName($name);
$stack = static::getStack();
if (isset($stack->{$name})) {
unset($stack->{$name});
}
......@@ -314,13 +314,13 @@ class Zend_Controller_Action_HelperBroker
*/
public static function getStack()
{
if (self::$_stack == null) {
self::$_stack = new Zend_Controller_Action_HelperBroker_PriorityStack();
if (static::$_stack == null) {
static::$_stack = new Zend_Controller_Action_HelperBroker_PriorityStack();
}
return self::$_stack;
return static::$_stack;
}
/**
* _loadHelper()
*
......@@ -331,7 +331,7 @@ class Zend_Controller_Action_HelperBroker
{
$file = $name . '.php';
$paths = array_reverse(self::$_paths);
$paths = array_reverse(static::$_paths);
foreach ($paths as $info) {
$dir = $info['dir'];
$prefix = $info['prefix'];
......@@ -345,7 +345,7 @@ class Zend_Controller_Action_HelperBroker
throw new Zend_Controller_Action_Exception('Helper name ' . $name . ' -> class ' . $class . ' is not of type Zend_Controller_Action_Helper_Abstract');
}
self::getStack()->push($helper);
static::getStack()->push($helper);
return;
} elseif (Zend_Loader::isReadable($dir . $file)) {
......@@ -357,7 +357,7 @@ class Zend_Controller_Action_HelperBroker
throw new Zend_Controller_Action_Exception('Helper name ' . $name . ' -> class ' . $class . ' is not of type Zend_Controller_Action_Helper_Abstract');
}
self::getStack()->push($helper);
static::getStack()->push($helper);
return;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment