Skip to content

Commit

Permalink
Merge branch 'hotfix/docblocks' of https://github.com/andriesss/zf2 i…
Browse files Browse the repository at this point in the history
…nto hotfix/docblocks
  • Loading branch information
weierophinney committed Mar 23, 2012
2 parents 87f0220 + b2b2448 commit 0a8b7db
Show file tree
Hide file tree
Showing 18 changed files with 342 additions and 340 deletions.
200 changes: 100 additions & 100 deletions library/Zend/Acl/Acl.php

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions library/Zend/Acl/Assertion.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ interface Assertion
* $role, $resource, or $privilege parameters are null, it means that the query applies to all Roles, Resources, or
* privileges, respectively.
*
* @param Zend\Acl\Acl $acl
* @param Zend\Acl\Role $role
* @param Zend\Acl\Resource $resource
* @param string $privilege
* @param Acl $acl
* @param Role $role
* @param Resource $resource
* @param string $privilege
* @return boolean
*/
public function assert(Acl $acl, Role $role = null, Resource $resource = null, $privilege = null);
Expand Down
32 changes: 16 additions & 16 deletions library/Zend/Acl/Role/Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ class Registry
* will have the least priority, and the last parent added will have the
* highest priority.
*
* @param Zend\Acl\Role $role
* @param Zend\Acl\Role|string|array $parents
* @throws Zend\Acl\Exception\InvalidArgumentException
* @return Zend\Acl\Role\Registry Provides a fluent interface
* @param \Zend\Acl\Role $role
* @param \Zend\Acl\Role|string|array $parents
* @throws \Zend\Acl\Exception\InvalidArgumentException
* @return Registry Provides a fluent interface
*/
public function add(Role $role, $parents = null)
{
Expand Down Expand Up @@ -108,9 +108,9 @@ public function add(Role $role, $parents = null)
*
* The $role parameter can either be a Role or a Role identifier.
*
* @param Zend\Acl\Role|string $role
* @throws Zend\Acl\Exception\InvalidArgumentException
* @return Zend\Acl\Role
* @param \Zend\Acl\Role|string $role
* @throws \Zend\Acl\Exception\InvalidArgumentException
* @return \Zend\Acl\Role
*/
public function get($role)
{
Expand All @@ -132,7 +132,7 @@ public function get($role)
*
* The $role parameter can either be a Role or a Role identifier.
*
* @param Zend\Acl\Role|string $role
* @param \Zend\Acl\Role|string $role
* @return boolean
*/
public function has($role)
Expand All @@ -157,7 +157,7 @@ public function has($role)
* If the Role does not have any parents, then an empty array is returned.
*
* @uses Zend\Acl\Role\Registry::get()
* @param Zend\Acl\Role|string $role
* @param \Zend\Acl\Role|string $role
* @return array
*/
public function getParents($role)
Expand All @@ -176,10 +176,10 @@ public function getParents($role)
* through the entire inheritance DAG to determine whether $role
* inherits from $inherit through its ancestor Roles.
*
* @param Zend\Acl\Role|string $role
* @param Zend\Acl\Role|string $inherit
* @param \Zend\Acl\Role|string $role
* @param \Zend\Acl\Role|string $inherit
* @param boolean $onlyParents
* @throws Zend\Acl\Exception\InvalidArgumentException
* @throws \Zend\Acl\Exception\InvalidArgumentException
* @return boolean
*/
public function inherits($role, $inherit, $onlyParents = false)
Expand Down Expand Up @@ -211,9 +211,9 @@ public function inherits($role, $inherit, $onlyParents = false)
*
* The $role parameter can either be a Role or a Role identifier.
*
* @param Zend\Acl\Role|string $role
* @throws Zend\Acl\Exception\InvalidArgumentException
* @return Zend\Acl\Role\Registry Provides a fluent interface
* @param \Zend\Acl\Role|string $role
* @throws \Zend\Acl\Exception\InvalidArgumentException
* @return Registry Provides a fluent interface
*/
public function remove($role)
{
Expand All @@ -238,7 +238,7 @@ public function remove($role)
/**
* Removes all Roles from the registry
*
* @return Zend\Acl\Role\Registry Provides a fluent interface
* @return Registry Provides a fluent interface
*/
public function removeAll()
{
Expand Down
44 changes: 22 additions & 22 deletions library/Zend/Mvc/Router/Http/Hostname.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,46 +49,46 @@ class Hostname implements Route

/**
* Constraints for parameters.
*
*
* @var array
*/
protected $constraints;

/**
* Default values.
*
* @var array
*/
protected $defaults;

/**
* List of assembled parameters.
*
*
* @var array
*/
protected $assembledParams = array();

/**
* Create a new hostname route.
*
*
* @param string $route
* @param array $constraints
* @param array $defaults
* @return void
* @param array $defaults
*/
public function __construct($route, array $constraints = array(), array $defaults = array())
{
$this->route = explode('.', $route);
$this->constraints = $constraints;
$this->defaults = $defaults;
}

/**
* factory(): defined by Route interface.
*
* @see Route::factory()
* @param array|Traversable $options
* @return void
* @param array|\Traversable $options
* @throws \Zend\Mvc\Router\Exception\InvalidArgumentException
* @return Hostname
*/
public static function factory($options = array())
{
Expand All @@ -105,7 +105,7 @@ public static function factory($options = array())
if (!isset($options['constraints'])) {
$options['constraints'] = array();
}

if (!isset($options['defaults'])) {
$options['defaults'] = array();
}
Expand Down Expand Up @@ -133,19 +133,19 @@ public function match(Request $request)
if (count($hostname) !== count($this->route)) {
return null;
}

foreach ($this->route as $index => $routePart) {
if (preg_match('(^:(?<name>.+)$)', $routePart, $matches)) {
if (isset($this->constraints[$matches['name']]) && !preg_match('(^' . $this->constraints[$matches['name']] . '$)', $hostname[$index])) {
return null;
}

$params[$matches['name']] = $hostname[$index];
} elseif ($hostname[$index] !== $routePart) {
return null;
}
}

return new RouteMatch(array_merge($this->defaults, $params));
}

Expand All @@ -161,34 +161,34 @@ public function assemble(array $params = array(), array $options = array())
{
$mergedParams = array_merge($this->defaults, $params);
$this->assembledParams = array();

if (isset($options['uri'])) {
$parts = array();

foreach ($this->route as $index => $routePart) {
if (preg_match('(^:(?<name>.+)$)', $routePart, $matches)) {
if (!isset($mergedParams[$matches['name']])) {
throw new Exception\InvalidArgumentException(sprintf('Missing parameter "%s"', $matches['name']));
}

$parts[] = $mergedParams[$matches['name']];

$this->assembledParams[] = $matches['name'];
} else {
$parts[] = $routePart;
}
}

$options['uri']->setHost(implode('.', $parts));
}

// A hostname does not contribute to the path, thus nothing is returned.
return '';
}

/**
* getAssembledParams(): defined by Route interface.
*
*
* @see Route::getAssembledParams
* @return array
*/
Expand Down
23 changes: 12 additions & 11 deletions library/Zend/Mvc/Router/Http/Literal.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,23 @@ class Literal implements Route

/**
* Create a new literal route.
*
*
* @param string $route
* @param array $defaults
* @return void
* @param array $defaults
*/
public function __construct($route, array $defaults = array())
{
$this->route = $route;
$this->defaults = $defaults;
}

/**
* factory(): defined by Route interface.
*
* @see Route::factory()
* @param array|Traversable $options
* @return void
* @param array|\Traversable $options
* @throws \Zend\Mvc\Router\Exception\InvalidArgumentException
* @return Literal
*/
public static function factory($options = array())
{
Expand All @@ -97,8 +97,9 @@ public static function factory($options = array())
* match(): defined by Route interface.
*
* @see Route::match()
* @param Request $request
* @return RouteMatch
* @param Request $request
* @param int|null $pathOffset
* @return RouteMatch|null
*/
public function match(Request $request, $pathOffset = null)
{
Expand All @@ -115,7 +116,7 @@ public function match(Request $request, $pathOffset = null)
return new RouteMatch($this->defaults, strlen($this->route));
}
}

return null;
}

Expand All @@ -138,10 +139,10 @@ public function assemble(array $params = array(), array $options = array())
{
return $this->route;
}

/**
* getAssembledParams(): defined by Route interface.
*
*
* @see Route::getAssembledParams
* @return array
*/
Expand Down
9 changes: 5 additions & 4 deletions library/Zend/Mvc/Router/Http/Part.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ class Part extends TreeRouteStack implements Route
* @param mixed $route
* @param boolean $mayTerminate
* @param RouteBroker $routeBroker
* @param array $childRoutes
* @return void
* @param array|null $childRoutes
*/
public function __construct($route, $mayTerminate, RouteBroker $routeBroker, array $childRoutes = null)
{
Expand All @@ -95,7 +94,8 @@ public function __construct($route, $mayTerminate, RouteBroker $routeBroker, arr
*
* @see Route::factory()
* @param mixed $options
* @return void
* @throws \Zend\Mvc\Router\Exception\InvalidArgumentException
* @return Part
*/
public static function factory($options = array())
{
Expand Down Expand Up @@ -131,7 +131,8 @@ public static function factory($options = array())
* match(): defined by Route interface.
*
* @see Route::match()
* @param Request $request
* @param Request $request
* @param int|null $pathOffset
* @return RouteMatch|null
*/
public function match(Request $request, $pathOffset = null)
Expand Down
Loading

0 comments on commit 0a8b7db

Please sign in to comment.