Skip to content

Commit

Permalink
phpdoc fixes in Zend\Mvc, some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
prolic committed Jun 6, 2012
1 parent 1ce29f1 commit dbf4614
Show file tree
Hide file tree
Showing 22 changed files with 55 additions and 42 deletions.
2 changes: 1 addition & 1 deletion library/Zend/EventManager/EventManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function attach($event, $callback = null, $priority = 1);
* Detach an event listener
*
* @param CallbackHandler|ListenerAggregateInterface $listener
* @return void
* @return bool
*/
public function detach($listener);

Expand Down
12 changes: 6 additions & 6 deletions library/Zend/Mvc/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Application implements
protected $event;

/**
* @var EventManager
* @var EventManagerInterface
*/
protected $events;

Expand Down Expand Up @@ -111,7 +111,7 @@ class Application implements
* Constructor
*
* @param mixed $configuration
* @param ServiceManager $serviceManager
* @param ServiceManager $serviceManager
*/
public function __construct($configuration, ServiceManager $serviceManager)
{
Expand Down Expand Up @@ -179,7 +179,7 @@ public function getServiceManager()
/**
* Get the request object
*
* @return Request
* @return RequestInterface
*/
public function getRequest()
{
Expand All @@ -189,7 +189,7 @@ public function getRequest()
/**
* Get the response object
*
* @return Response
* @return ResponseInterface
*/
public function getResponse()
{
Expand Down Expand Up @@ -249,7 +249,7 @@ public function events()
* discovered controller, and controller class (if known).
* Typically, a handler should return a populated Response object
* that can be returned immediately.
* @return SendableResponse
* @return ResponseInterface
*/
public function run()
{
Expand Down Expand Up @@ -309,7 +309,7 @@ public function run()
* event object.
*
* @param MvcEvent $event
* @return Response
* @return ResponseInterface
*/
protected function completeRequest(MvcEvent $event)
{
Expand Down
6 changes: 4 additions & 2 deletions library/Zend/Mvc/ApplicationInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
namespace Zend\Mvc;

use Zend\EventManager\EventsCapableInterface;
use Zend\Stdlib\RequestInterface;
use Zend\Stdlib\ResponseInterface;

/**
* @category Zend
Expand All @@ -40,14 +42,14 @@ public function getServiceManager();
/**
* Get the request object
*
* @return Request
* @return RequestInterface
*/
public function getRequest();

/**
* Get the response object
*
* @return Response
* @return ResponseInterface
*/
public function getResponse();

Expand Down
11 changes: 6 additions & 5 deletions library/Zend/Mvc/Controller/ActionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ abstract class ActionController implements
/**
* Default action if none provided
*
* @return array
* @return ViewModel
*/
public function indexAction()
{
Expand All @@ -80,7 +80,7 @@ public function indexAction()
/**
* Action called if matched action does not exist
*
* @return array
* @return ViewModel
*/
public function notFoundAction()
{
Expand Down Expand Up @@ -253,11 +253,12 @@ public function getEvent()
* Set locator instance
*
* @param ServiceLocatorInterface $locator
* @return void
* @return ActionController
*/
public function setServiceLocator(ServiceLocatorInterface $locator)
{
$this->locator = $locator;
return $this;
}

/**
Expand All @@ -273,7 +274,7 @@ public function getServiceLocator()
/**
* Get plugin broker instance
*
* @return Zend\Loader\Broker
* @return Broker
*/
public function getBroker()
{
Expand All @@ -287,7 +288,7 @@ public function getBroker()
* Set plugin broker instance
*
* @param string|Broker $broker Plugin broker to load plugins
* @return Zend\Loader\Pluggable
* @return ActionController
* @throws Exception\InvalidArgumentException
*/
public function setBroker($broker)
Expand Down
3 changes: 3 additions & 0 deletions library/Zend/Mvc/Controller/Plugin/AbstractPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
*/
abstract class AbstractPlugin
{
/**
* @var Dispatchable
*/
protected $controller;

/**
Expand Down
19 changes: 12 additions & 7 deletions library/Zend/Mvc/Controller/RestfulController.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ abstract class RestfulController implements
protected $events;

/**
* @var Locator
* @var ServiceLocatorInterface
*/
protected $locator;

Expand Down Expand Up @@ -176,6 +176,11 @@ public function dispatch(Request $request, Response $response = null)
return $e->getResult();
}

/**
* @param MvcEvent $e
* @return mixed
* @throws Exception\DomainException
*/
public function execute(MvcEvent $e)
{
$routeMatch = $e->getRouteMatch();
Expand All @@ -184,7 +189,7 @@ public function execute(MvcEvent $e)
* @todo Determine requirements for when route match is missing.
* Potentially allow pulling directly from request metadata?
*/
throw new \DomainException('Missing route matches; unsure how to retrieve action');
throw new Exception\DomainException('Missing route matches; unsure how to retrieve action');
}

$request = $e->getRequest();
Expand Down Expand Up @@ -216,7 +221,7 @@ public function execute(MvcEvent $e)
case 'put':
if (null === $id = $routeMatch->getParam('id')) {
if (!($id = $request->query()->get('id', false))) {
throw new \DomainException('Missing identifier');
throw new Exception\DomainException('Missing identifier');
}
}
$content = $request->getContent();
Expand All @@ -226,13 +231,13 @@ public function execute(MvcEvent $e)
case 'delete':
if (null === $id = $routeMatch->getParam('id')) {
if (!($id = $request->query()->get('id', false))) {
throw new \DomainException('Missing identifier');
throw new Exception\DomainException('Missing identifier');
}
}
$return = $this->delete($id);
break;
default:
throw new \DomainException('Invalid HTTP method!');
throw new Exception\DomainException('Invalid HTTP method!');
}
}

Expand Down Expand Up @@ -360,7 +365,7 @@ public function getServiceLocator()
/**
* Get plugin broker instance
*
* @return Zend\Loader\Broker
* @return Broker
*/
public function getBroker()
{
Expand All @@ -374,7 +379,7 @@ public function getBroker()
* Set plugin broker instance
*
* @param string|Broker $broker Plugin broker to load plugins
* @return Zend\Loader\Pluggable
* @return RestfulController
* @throws Exception\InvalidArgumentException
*/
public function setBroker($broker)
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Mvc/MvcEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class MvcEvent extends Event
* Set application instance
*
* @param ApplicationInterface $application
* @return Mvc
* @return MvcEvent
*/
public function setApplication(ApplicationInterface $application)
{
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Mvc/Router/Http/Hostname.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ public function __construct($route, array $constraints = array(), array $default
* factory(): defined by RouteInterface interface.
*
* @see Route::factory()
* @param array|\Traversable $options
* @throws \Zend\Mvc\Router\Exception\InvalidArgumentException
* @param array|Traversable $options
* @throws Exception\InvalidArgumentException
* @return Hostname
*/
public static function factory($options = array())
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Mvc/Router/Http/Literal.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public function __construct($route, array $defaults = array())
* factory(): defined by RouteInterface interface.
*
* @see Route::factory()
* @param array|\Traversable $options
* @throws \Zend\Mvc\Router\Exception\InvalidArgumentException
* @param array|Traversable $options
* @throws Exception\InvalidArgumentException
* @return Literal
*/
public static function factory($options = array())
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Mvc/Router/Http/Part.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function __construct($route, $mayTerminate, RouteBroker $routeBroker, arr
*
* @see Route::factory()
* @param mixed $options
* @throws \Zend\Mvc\Router\Exception\InvalidArgumentException
* @throws Exception\InvalidArgumentException
* @return Part
*/
public static function factory($options = array())
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Mvc/Router/Http/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public function __construct(array $defaults = array())
* factory(): defined by RouteInterface interface.
*
* @see Route::factory()
* @param array|\Traversable $options
* @throws \Zend\Mvc\Router\Exception\InvalidArgumentException
* @param array|Traversable $options
* @throws Exception\InvalidArgumentException
* @return Query
*/
public static function factory($options = array())
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Mvc/Router/Http/Regex.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ public function __construct($regex, $spec, array $defaults = array())
* factory(): defined by RouteInterface interface.
*
* @see Route::factory()
* @param array|\Traversable $options
* @throws \Zend\Mvc\Router\Exception\InvalidArgumentException
* @param array|Traversable $options
* @throws Exception\InvalidArgumentException
* @return Regex
*/
public static function factory($options = array())
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Mvc/Router/Http/Scheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public function __construct($scheme, array $defaults = array())
* factory(): defined by RouteInterface interface.
*
* @see Route::factory()
* @param array|\Traversable $options
* @throws \Zend\Mvc\Router\Exception\InvalidArgumentException
* @param array|Traversable $options
* @throws Exception\InvalidArgumentException
* @return Scheme
*/
public static function factory($options = array())
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Mvc/Router/Http/Segment.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function __construct($route, array $constraints = array(), array $default
*
* @see Route::factory()
* @param array|Traversable $options
* @throws \Zend\Mvc\Router\Exception\InvalidArgumentException
* @throws Exception\InvalidArgumentException
* @return Segment
*/
public static function factory($options = array())
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Mvc/Router/Http/TreeRouteStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function addRoute($name, $route, $priority = null)
* routeFromArray(): defined by SimpleRouteStack.
*
* @see SimpleRouteStack::routeFromArray()
* @param array|\Traversable $specs
* @param array|Traversable $specs
* @return RouteInterface
*/
protected function routeFromArray($specs)
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Mvc/Router/Http/Wildcard.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function __construct($keyValueDelimiter = '/', $paramDelimiter = '/', arr
*
* @see Route::factory()
* @param array|Traversable $options
* @throws \Zend\Mvc\Router\Exception\InvalidArgumentException
* @throws Exception\InvalidArgumentException
* @return Wildcard
*/
public static function factory($options = array())
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Mvc/Router/SimpleRouteStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function __construct()
* factory(): defined by RouteInterface interface.
*
* @see Route::factory()
* @param array|\Traversable $options
* @param array|Traversable $options
* @return SimpleRouteStack
* @throws Exception\InvalidArgumentException
*/
Expand Down Expand Up @@ -135,7 +135,7 @@ public function routeBroker()
* addRoutes(): defined by RouteStackInterface interface.
*
* @see RouteStack::addRoutes()
* @param array|\Traversable $routes
* @param array|Traversable $routes
* @return SimpleRouteStack
* @throws Exception\InvalidArgumentException
*/
Expand Down
3 changes: 2 additions & 1 deletion library/Zend/Mvc/Service/RouterFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

namespace Zend\Mvc\Service;

use Zend\Mvc\Router\SimpleRouteStack;
use Zend\Mvc\Router\Http\TreeRouteStack as Router;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
Expand All @@ -42,7 +43,7 @@ class RouterFactory implements FactoryInterface
* default.
*
* @param ServiceLocatorInterface $serviceLocator
* @return TreeRouteStack
* @return SimpleRouteStack
*/
public function createService(ServiceLocatorInterface $serviceLocator)
{
Expand Down
1 change: 1 addition & 0 deletions library/Zend/Mvc/Service/ServiceManagerConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

namespace Zend\Mvc\Service;

use Zend\EventManager\EventManagerAwareInterface;
use Zend\ServiceManager\ConfigurationInterface;
use Zend\ServiceManager\ServiceManager;
use Zend\ServiceManager\ServiceManagerAwareInterface;
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Mvc/Service/ViewFeedRendererFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ViewFeedRendererFactory implements FactoryInterface
* Create and return the feed view renderer
*
* @param ServiceLocatorInterface $serviceLocator
* @return FeedStrategy
* @return FeedRenderer
*/
public function createService(ServiceLocatorInterface $serviceLocator)
{
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Mvc/Service/ViewJsonRendererFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ViewJsonRendererFactory implements FactoryInterface
* Create and return the JSON view renderer
*
* @param ServiceLocatorInterface $serviceLocator
* @return JsonStrategy
* @return JsonRenderer
*/
public function createService(ServiceLocatorInterface $serviceLocator)
{
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Mvc/View/ViewManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ public function getRouteNotFoundStrategy()
/**
* Configures the MvcEvent view model to ensure it has the template injected
*
* @return \Zend\Mvc\View\Model\ModelInterface
* @return \Zend\View\Model\ModelInterface
*/
public function getViewModel()
{
Expand Down

0 comments on commit dbf4614

Please sign in to comment.