Просмотр исходного кода

Fixes DocBlocks in Zend_Controller_Router - Closes #434

Frank Brückner 11 лет назад
Родитель
Сommit
8b82bb5513

+ 4 - 5
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 @@ abstract class Zend_Controller_Router_Abstract implements Zend_Controller_Router
      * 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 @@ abstract class Zend_Controller_Router_Abstract implements Zend_Controller_Router
      * 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 @@ abstract class Zend_Controller_Router_Abstract implements Zend_Controller_Router
      * 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)
     {

+ 1 - 1
library/Zend/Controller/Router/Interface.php

@@ -81,7 +81,7 @@ interface Zend_Controller_Router_Interface
      * 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);

+ 11 - 3
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 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract
     /**
      * Remove all standard default routes
      *
-     * @param  Zend_Controller_Router_Route_Interface Route
      * @return Zend_Controller_Router_Rewrite
      */
     public function removeDefaultRoutes()
@@ -340,7 +339,7 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract
      * 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 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract
      * 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 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract
 
     }
 
+    /**
+     * 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) {

+ 12 - 5
library/Zend/Controller/Router/Route.php

@@ -137,6 +137,7 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
      * 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 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
      * 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 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
      * 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 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
     /**
      * 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)

+ 11 - 0
library/Zend/Controller/Router/Route/Chain.php

@@ -33,7 +33,18 @@ require_once 'Zend/Controller/Router/Route/Abstract.php';
  */
 class Zend_Controller_Router_Route_Chain extends Zend_Controller_Router_Route_Abstract
 {
+    /**
+     * Routes
+     *
+     * @var array
+     */
     protected $_routes = array();
+
+    /**
+     * Separators
+     *
+     * @var array
+     */
     protected $_separators = array();
 
     /**

+ 28 - 3
library/Zend/Controller/Router/Route/Hostname.php

@@ -34,13 +34,30 @@ require_once 'Zend/Controller/Router/Route/Abstract.php';
  */
 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 @@ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route
      * 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 @@ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route
     /**
      * 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)

+ 30 - 5
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 @@ class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_A
      * 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 @@ class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_A
     /**
      * 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)

+ 48 - 1
library/Zend/Controller/Router/Route/Regex.php

@@ -33,16 +33,46 @@ require_once 'Zend/Controller/Router/Route/Abstract.php';
  */
 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 @@ class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Ab
         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 @@ class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Ab
         $this->_reverse  = $reverse;
     }
 
+    /**
+     * Get the version of the route
+     *
+     * @return int
+     */
     public function getVersion() {
         return 1;
     }
@@ -159,7 +202,11 @@ class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Ab
     /**
      * 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)

+ 17 - 1
library/Zend/Controller/Router/Route/Static.php

@@ -35,10 +35,25 @@ require_once 'Zend/Controller/Router/Route/Abstract.php';
  */
 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 @@ class Zend_Controller_Router_Route_Static extends Zend_Controller_Router_Route_A
      * 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)
     {