ZF-8821: Incorrect signature Zend_Controller_Action_Helper_ContextSwitch::getActionContexts($action = null)

Description

Such declaration cause method to return an empty array if it will called without param

Althought, according to phpDoc, method should to return context for ALL actions in controller

Possible fixes

  1. Correct default value in method signature from null to empty string


2. Or change these comparison to non-strict
From

if (null !== $action) { if (isset($controller->{$contextKey}[$action])) { return $controller->{$contextKey}[$action]; } else { return array(); } }


To

if (null != $action) { if (isset($controller->{$contextKey}[$action])) { return $controller->{$contextKey}[$action]; } else { return array(); } }


then we could reach the last line of the method

Comments

No comments to display