diff --git a/library/Zend/Controller/Router/Abstract.php b/library/Zend/Controller/Router/Abstract.php index 0bb9804db8..29f221e1f4 100644 --- a/library/Zend/Controller/Router/Abstract.php +++ b/library/Zend/Controller/Router/Abstract.php @@ -58,7 +58,6 @@ abstract class Zend_Controller_Router_Abstract implements Zend_Controller_Router * Constructor * * @param array $params - * @return void */ public function __construct(array $params = array()) { @@ -69,8 +68,8 @@ public function __construct(array $params = array()) * Add or modify a parameter to use when instantiating an action controller * * @param string $name - * @param mixed $value - * @return Zend_Controller_Router + * @param mixed $value + * @return Zend_Controller_Router_Abstract */ public function setParam($name, $value) { @@ -83,7 +82,7 @@ public function setParam($name, $value) * Set parameters to pass to action controller constructors * * @param array $params - * @return Zend_Controller_Router + * @return Zend_Controller_Router_Abstract */ public function setParams(array $params) { @@ -124,7 +123,7 @@ public function getParams() * each. * * @param null|string|array single key or array of keys for params to clear - * @return Zend_Controller_Router + * @return Zend_Controller_Router_Abstract */ public function clearParams($name = null) { diff --git a/library/Zend/Controller/Router/Interface.php b/library/Zend/Controller/Router/Interface.php index 8d6a98e583..cf1b835d4e 100644 --- a/library/Zend/Controller/Router/Interface.php +++ b/library/Zend/Controller/Router/Interface.php @@ -81,7 +81,7 @@ public function setFrontController(Zend_Controller_Front $controller); * Add or modify a parameter with which to instantiate any helper objects * * @param string $name - * @param mixed $param + * @param mixed $value * @return Zend_Controller_Router_Interface */ public function setParam($name, $value); diff --git a/library/Zend/Controller/Router/Rewrite.php b/library/Zend/Controller/Router/Rewrite.php index 2c58b1b36d..d527ce4d2e 100644 --- a/library/Zend/Controller/Router/Rewrite.php +++ b/library/Zend/Controller/Router/Rewrite.php @@ -55,7 +55,7 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract /** * Currently matched route * - * @var Zend_Controller_Router_Route_Interface + * @var string */ protected $_currentRoute = null; @@ -283,7 +283,6 @@ public function removeRoute($name) /** * Remove all standard default routes * - * @param Zend_Controller_Router_Route_Interface Route * @return Zend_Controller_Router_Rewrite */ public function removeDefaultRoutes() @@ -340,7 +339,7 @@ public function getCurrentRoute() * Retrieve a name of currently matched route * * @throws Zend_Controller_Router_Exception - * @return Zend_Controller_Router_Route_Interface Route object + * @return string Route name */ public function getCurrentRouteName() { @@ -365,6 +364,7 @@ public function getRoutes() * Find a matching route to the current PATH_INFO and inject * returning values to the Request object. * + * @param Zend_Controller_Request_Abstract $request * @throws Zend_Controller_Router_Exception * @return Zend_Controller_Request_Abstract Request object */ @@ -419,6 +419,14 @@ public function route(Zend_Controller_Request_Abstract $request) } + /** + * Sets parameters for request object + * + * Module name, controller name and action name + * + * @param Zend_Controller_Request_Abstract $request + * @param array $params + */ protected function _setRequestParams($request, $params) { foreach ($params as $param => $value) { diff --git a/library/Zend/Controller/Router/Route.php b/library/Zend/Controller/Router/Route.php index 36d2c11818..d4907f02f0 100644 --- a/library/Zend/Controller/Router/Route.php +++ b/library/Zend/Controller/Router/Route.php @@ -137,6 +137,7 @@ public function getVersion() { * Instantiates route based on passed Zend_Config structure * * @param Zend_Config $config Configuration object + * @return Zend_Controller_Router_Route */ public static function getInstance(Zend_Config $config) { @@ -150,10 +151,11 @@ public static function getInstance(Zend_Config $config) * to a corresponding atomic parts. These parts are assigned * a position which is later used for matching and preparing values. * - * @param string $route Map used to match with later submitted URL path - * @param array $defaults Defaults for map variables with keys as variable names - * @param array $reqs Regular expression requirements for variables (keys as variable names) + * @param string $route Map used to match with later submitted URL path + * @param array $defaults Defaults for map variables with keys as variable names + * @param array $reqs Regular expression requirements for variables (keys as variable names) * @param Zend_Translate $translator Translator to use for this instance + * @param mixed|null $locale */ public function __construct($route, $defaults = array(), $reqs = array(), Zend_Translate $translator = null, $locale = null) { @@ -199,7 +201,9 @@ public function __construct($route, $defaults = array(), $reqs = array(), Zend_T * Matches a user submitted path with parts defined by a map. Assigns and * returns an array of variables on a successful match. * - * @param string $path Path used to match against this routing map + * @param string $path Path used to match against this routing map + * @param boolean $partial + * @throws Zend_Controller_Router_Exception * @return array|false An array of assigned values or a false on a mismatch */ public function match($path, $partial = false) @@ -311,8 +315,11 @@ public function match($path, $partial = false) /** * Assembles user submitted parameters forming a URL path defined by this route * - * @param array $data An array of variable and value pairs used as parameters + * @param array $data An array of variable and value pairs used as parameters * @param boolean $reset Whether or not to set route defaults with those provided in $data + * @param boolean $encode + * @param boolean $partial + * @throws Zend_Controller_Router_Exception * @return string Route path with user submitted parameters */ public function assemble($data = array(), $reset = false, $encode = false, $partial = false) diff --git a/library/Zend/Controller/Router/Route/Chain.php b/library/Zend/Controller/Router/Route/Chain.php index 126964be1f..e320f33377 100644 --- a/library/Zend/Controller/Router/Route/Chain.php +++ b/library/Zend/Controller/Router/Route/Chain.php @@ -33,7 +33,18 @@ */ class Zend_Controller_Router_Route_Chain extends Zend_Controller_Router_Route_Abstract { + /** + * Routes + * + * @var array + */ protected $_routes = array(); + + /** + * Separators + * + * @var array + */ protected $_separators = array(); /** diff --git a/library/Zend/Controller/Router/Route/Hostname.php b/library/Zend/Controller/Router/Route/Hostname.php index ad9fc986e5..bf1e348362 100644 --- a/library/Zend/Controller/Router/Route/Hostname.php +++ b/library/Zend/Controller/Router/Route/Hostname.php @@ -34,13 +34,30 @@ */ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route_Abstract { - + /** + * Host variable + * + * @var string + */ protected $_hostVariable = ':'; + + /** + * Regex delimiter + * + * @var string + */ protected $_regexDelimiter = '#'; + + /** + * Default regex string + * + * @var string|null + */ protected $_defaultRegex = null; /** * Holds names of all route's pattern variable names. Array index holds a position in host. + * * @var array */ protected $_variables = array(); @@ -48,12 +65,14 @@ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route /** * Holds Route patterns for all host parts. In case of a variable it stores it's regex * requirement or null. In case of a static part, it holds only it's direct value. + * * @var array */ protected $_parts = array(); /** * Holds user submitted default values for route's variables. Name and value pairs. + * * @var array */ protected $_defaults = array(); @@ -61,12 +80,14 @@ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route /** * Holds user submitted regular expression patterns for route's variables' values. * Name and value pairs. + * * @var array */ protected $_requirements = array(); /** * Default scheme + * * @var string */ protected $_scheme = null; @@ -74,6 +95,7 @@ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route /** * Associative array filled on match() that holds matched path values * for given variable names. + * * @var array */ protected $_values = array(); @@ -96,7 +118,6 @@ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route * Set the request object * * @param Zend_Controller_Request_Abstract|null $request - * @return void */ public function setRequest(Zend_Controller_Request_Abstract $request = null) { @@ -122,6 +143,7 @@ public function getRequest() * Instantiates route based on passed Zend_Config structure * * @param Zend_Config $config Configuration object + * @return Zend_Controller_Router_Route_Hostname */ public static function getInstance(Zend_Config $config) { @@ -245,8 +267,11 @@ public function match($request) /** * Assembles user submitted parameters forming a hostname defined by this route * - * @param array $data An array of variable and value pairs used as parameters + * @param array $data An array of variable and value pairs used as parameters * @param boolean $reset Whether or not to set route defaults with those provided in $data + * @param boolean $encode + * @param boolean $partial + * @throws Zend_Controller_Router_Exception * @return string Route path with user submitted parameters */ public function assemble($data = array(), $reset = false, $encode = false, $partial = false) diff --git a/library/Zend/Controller/Router/Route/Module.php b/library/Zend/Controller/Router/Route/Module.php index 1c89699a4a..1505483332 100644 --- a/library/Zend/Controller/Router/Route/Module.php +++ b/library/Zend/Controller/Router/Route/Module.php @@ -38,13 +38,27 @@ class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_A { /** * Default values for the route (ie. module, controller, action, params) + * * @var array */ protected $_defaults; - protected $_values = array(); + /** + * Default values for the route (ie. module, controller, action, params) + * + * @var array + */ + protected $_values = array(); + + /** + * @var boolean + */ protected $_moduleValid = false; - protected $_keysSet = false; + + /** + * @var boolean + */ + protected $_keysSet = false; /**#@+ * Array keys to use for module, controller, and action. Should be taken out of request. @@ -65,12 +79,20 @@ class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_A */ protected $_request; + /** + * Get the version of the route + * + * @return int + */ public function getVersion() { return 1; } /** * Instantiates route based on passed Zend_Config structure + * + * @param Zend_Config $config + * @return Zend_Controller_Router_Route_Module */ public static function getInstance(Zend_Config $config) { @@ -137,7 +159,8 @@ protected function _setRequestKeys() * setControllerName(), and setActionName() accessors to set those values. * Always returns the values as an array. * - * @param string $path Path used to match against this routing map + * @param string $path Path used to match against this routing map + * @param boolean $partial * @return array An array of assigned values or a false on a mismatch */ public function match($path, $partial = false) @@ -190,8 +213,10 @@ public function match($path, $partial = false) /** * Assembles user submitted parameters forming a URL path defined by this route * - * @param array $data An array of variable and value pairs used as parameters - * @param bool $reset Weither to reset the current params + * @param array $data An array of variable and value pairs used as parameters + * @param boolean $reset Weither to reset the current params + * @param boolean $encode + * @param boolean $partial * @return string Route path with user submitted parameters */ public function assemble($data = array(), $reset = false, $encode = true, $partial = false) diff --git a/library/Zend/Controller/Router/Route/Regex.php b/library/Zend/Controller/Router/Route/Regex.php index 9a9c49430f..400757ea20 100644 --- a/library/Zend/Controller/Router/Route/Regex.php +++ b/library/Zend/Controller/Router/Route/Regex.php @@ -33,16 +33,46 @@ */ class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Abstract { + /** + * Regex string + * + * @var string|null + */ protected $_regex = null; + + /** + * Default values for the route (ie. module, controller, action, params) + * + * @var array + */ protected $_defaults = array(); + + /** + * Reverse + * + * @var string|null + */ protected $_reverse = null; + + /** + * Map + * + * @var array + */ protected $_map = array(); + + /** + * Values + * + * @var array + */ protected $_values = array(); /** * Instantiates route based on passed Zend_Config structure * * @param Zend_Config $config Configuration object + * @return Zend_Controller_Router_Route_Regex */ public static function getInstance(Zend_Config $config) { @@ -52,6 +82,14 @@ public static function getInstance(Zend_Config $config) return new self($config->route, $defs, $map, $reverse); } + /** + * Constructor + * + * @param $route + * @param array $defaults + * @param array $map + * @param null $reverse + */ public function __construct($route, $defaults = array(), $map = array(), $reverse = null) { $this->_regex = $route; @@ -60,6 +98,11 @@ public function __construct($route, $defaults = array(), $map = array(), $revers $this->_reverse = $reverse; } + /** + * Get the version of the route + * + * @return int + */ public function getVersion() { return 1; } @@ -159,7 +202,11 @@ protected function _getMappedValues($values, $reversed = false, $preserve = fals /** * Assembles a URL path defined by this route * - * @param array $data An array of name (or index) and value pairs used as parameters + * @param array $data An array of name (or index) and value pairs used as parameters + * @param boolean $reset + * @param boolean $encode + * @param boolean $partial + * @throws Zend_Controller_Router_Exception * @return string Route path with user submitted parameters */ public function assemble($data = array(), $reset = false, $encode = false, $partial = false) diff --git a/library/Zend/Controller/Router/Route/Static.php b/library/Zend/Controller/Router/Route/Static.php index 8029acb6d5..5869b06e7d 100644 --- a/library/Zend/Controller/Router/Route/Static.php +++ b/library/Zend/Controller/Router/Route/Static.php @@ -35,10 +35,25 @@ */ class Zend_Controller_Router_Route_Static extends Zend_Controller_Router_Route_Abstract { - + /** + * Route + * + * @var string|null + */ protected $_route = null; + + /** + * Default values for the route (ie. module, controller, action, params) + * + * @var array + */ protected $_defaults = array(); + /** + * Get the version of the route + * + * @return int + */ public function getVersion() { return 1; } @@ -47,6 +62,7 @@ public function getVersion() { * Instantiates route based on passed Zend_Config structure * * @param Zend_Config $config Configuration object + * @return Zend_Controller_Router_Route_Static */ public static function getInstance(Zend_Config $config) {