Permalink
Browse files

phpdoc fixes in Zend\Mvc, some cleanup

  • Loading branch information...
1 parent 1ce29f1 commit dbf4614a7da1a4667fc30098207561c6d8bb236a @prolic prolic committed Jun 6, 2012
@@ -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);
@@ -83,7 +83,7 @@ class Application implements
protected $event;
/**
- * @var EventManager
+ * @var EventManagerInterface
*/
protected $events;
@@ -111,7 +111,7 @@ class Application implements
* Constructor
*
* @param mixed $configuration
- * @param ServiceManager $serviceManager
+ * @param ServiceManager $serviceManager
*/
public function __construct($configuration, ServiceManager $serviceManager)
{
@@ -179,7 +179,7 @@ public function getServiceManager()
/**
* Get the request object
*
- * @return Request
+ * @return RequestInterface
*/
public function getRequest()
{
@@ -189,7 +189,7 @@ public function getRequest()
/**
* Get the response object
*
- * @return Response
+ * @return ResponseInterface
*/
public function getResponse()
{
@@ -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()
{
@@ -309,7 +309,7 @@ public function run()
* event object.
*
* @param MvcEvent $event
- * @return Response
+ * @return ResponseInterface
*/
protected function completeRequest(MvcEvent $event)
{
@@ -21,6 +21,8 @@
namespace Zend\Mvc;
use Zend\EventManager\EventsCapableInterface;
+use Zend\Stdlib\RequestInterface;
+use Zend\Stdlib\ResponseInterface;
/**
* @category Zend
@@ -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();
@@ -68,7 +68,7 @@
/**
* Default action if none provided
*
- * @return array
+ * @return ViewModel
*/
public function indexAction()
{
@@ -80,7 +80,7 @@ public function indexAction()
/**
* Action called if matched action does not exist
*
- * @return array
+ * @return ViewModel
*/
public function notFoundAction()
{
@@ -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;
}
/**
@@ -273,7 +274,7 @@ public function getServiceLocator()
/**
* Get plugin broker instance
*
- * @return Zend\Loader\Broker
+ * @return Broker
*/
public function getBroker()
{
@@ -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)
@@ -32,6 +32,9 @@
*/
abstract class AbstractPlugin
{
+ /**
+ * @var Dispatchable
+ */
protected $controller;
/**
@@ -82,7 +82,7 @@
protected $events;
/**
- * @var Locator
+ * @var ServiceLocatorInterface
*/
protected $locator;
@@ -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();
@@ -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();
@@ -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();
@@ -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!');
}
}
@@ -360,7 +365,7 @@ public function getServiceLocator()
/**
* Get plugin broker instance
*
- * @return Zend\Loader\Broker
+ * @return Broker
*/
public function getBroker()
{
@@ -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)
@@ -81,7 +81,7 @@ class MvcEvent extends Event
* Set application instance
*
* @param ApplicationInterface $application
- * @return Mvc
+ * @return MvcEvent
*/
public function setApplication(ApplicationInterface $application)
{
@@ -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())
@@ -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())
@@ -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())
@@ -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())
@@ -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())
@@ -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())
@@ -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())
@@ -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)
@@ -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())
@@ -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
*/
@@ -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
*/
@@ -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;
@@ -42,7 +43,7 @@ class RouterFactory implements FactoryInterface
* default.
*
* @param ServiceLocatorInterface $serviceLocator
- * @return TreeRouteStack
+ * @return SimpleRouteStack
*/
public function createService(ServiceLocatorInterface $serviceLocator)
{
@@ -21,6 +21,7 @@
namespace Zend\Mvc\Service;
+use Zend\EventManager\EventManagerAwareInterface;
use Zend\ServiceManager\ConfigurationInterface;
use Zend\ServiceManager\ServiceManager;
use Zend\ServiceManager\ServiceManagerAwareInterface;
@@ -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)
{
@@ -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)
{
@@ -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()
{

0 comments on commit dbf4614

Please sign in to comment.