Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

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
Expand Up @@ -84,7 +84,7 @@ public function attach($event, $callback = null, $priority = 1);
* Detach an event listener * Detach an event listener
* *
* @param CallbackHandler|ListenerAggregateInterface $listener * @param CallbackHandler|ListenerAggregateInterface $listener
* @return void * @return bool
*/ */
public function detach($listener); public function detach($listener);


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


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


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


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


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


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


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


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


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


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


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


/**
* @param MvcEvent $e
* @return mixed
* @throws Exception\DomainException
*/
public function execute(MvcEvent $e) public function execute(MvcEvent $e)
{ {
$routeMatch = $e->getRouteMatch(); $routeMatch = $e->getRouteMatch();
Expand All @@ -184,7 +189,7 @@ public function execute(MvcEvent $e)
* @todo Determine requirements for when route match is missing. * @todo Determine requirements for when route match is missing.
* Potentially allow pulling directly from request metadata? * 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(); $request = $e->getRequest();
Expand Down Expand Up @@ -216,7 +221,7 @@ public function execute(MvcEvent $e)
case 'put': case 'put':
if (null === $id = $routeMatch->getParam('id')) { if (null === $id = $routeMatch->getParam('id')) {
if (!($id = $request->query()->get('id', false))) { if (!($id = $request->query()->get('id', false))) {
throw new \DomainException('Missing identifier'); throw new Exception\DomainException('Missing identifier');
} }
} }
$content = $request->getContent(); $content = $request->getContent();
Expand All @@ -226,13 +231,13 @@ public function execute(MvcEvent $e)
case 'delete': case 'delete':
if (null === $id = $routeMatch->getParam('id')) { if (null === $id = $routeMatch->getParam('id')) {
if (!($id = $request->query()->get('id', false))) { if (!($id = $request->query()->get('id', false))) {
throw new \DomainException('Missing identifier'); throw new Exception\DomainException('Missing identifier');
} }
} }
$return = $this->delete($id); $return = $this->delete($id);
break; break;
default: 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 * Get plugin broker instance
* *
* @return Zend\Loader\Broker * @return Broker
*/ */
public function getBroker() public function getBroker()
{ {
Expand All @@ -374,7 +379,7 @@ public function getBroker()
* Set plugin broker instance * Set plugin broker instance
* *
* @param string|Broker $broker Plugin broker to load plugins * @param string|Broker $broker Plugin broker to load plugins
* @return Zend\Loader\Pluggable * @return RestfulController
* @throws Exception\InvalidArgumentException * @throws Exception\InvalidArgumentException
*/ */
public function setBroker($broker) public function setBroker($broker)
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Mvc/MvcEvent.php
Expand Up @@ -81,7 +81,7 @@ class MvcEvent extends Event
* Set application instance * Set application instance
* *
* @param ApplicationInterface $application * @param ApplicationInterface $application
* @return Mvc * @return MvcEvent
*/ */
public function setApplication(ApplicationInterface $application) public function setApplication(ApplicationInterface $application)
{ {
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Mvc/Router/Http/Hostname.php
Expand Up @@ -83,8 +83,8 @@ public function __construct($route, array $constraints = array(), array $default
* factory(): defined by RouteInterface interface. * factory(): defined by RouteInterface interface.
* *
* @see Route::factory() * @see Route::factory()
* @param array|\Traversable $options * @param array|Traversable $options
* @throws \Zend\Mvc\Router\Exception\InvalidArgumentException * @throws Exception\InvalidArgumentException
* @return Hostname * @return Hostname
*/ */
public static function factory($options = array()) public static function factory($options = array())
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Mvc/Router/Http/Literal.php
Expand Up @@ -67,8 +67,8 @@ public function __construct($route, array $defaults = array())
* factory(): defined by RouteInterface interface. * factory(): defined by RouteInterface interface.
* *
* @see Route::factory() * @see Route::factory()
* @param array|\Traversable $options * @param array|Traversable $options
* @throws \Zend\Mvc\Router\Exception\InvalidArgumentException * @throws Exception\InvalidArgumentException
* @return Literal * @return Literal
*/ */
public static function factory($options = array()) public static function factory($options = array())
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Mvc/Router/Http/Part.php
Expand Up @@ -92,7 +92,7 @@ public function __construct($route, $mayTerminate, RouteBroker $routeBroker, arr
* *
* @see Route::factory() * @see Route::factory()
* @param mixed $options * @param mixed $options
* @throws \Zend\Mvc\Router\Exception\InvalidArgumentException * @throws Exception\InvalidArgumentException
* @return Part * @return Part
*/ */
public static function factory($options = array()) public static function factory($options = array())
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Mvc/Router/Http/Query.php
Expand Up @@ -68,8 +68,8 @@ public function __construct(array $defaults = array())
* factory(): defined by RouteInterface interface. * factory(): defined by RouteInterface interface.
* *
* @see Route::factory() * @see Route::factory()
* @param array|\Traversable $options * @param array|Traversable $options
* @throws \Zend\Mvc\Router\Exception\InvalidArgumentException * @throws Exception\InvalidArgumentException
* @return Query * @return Query
*/ */
public static function factory($options = array()) public static function factory($options = array())
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Mvc/Router/Http/Regex.php
Expand Up @@ -85,8 +85,8 @@ public function __construct($regex, $spec, array $defaults = array())
* factory(): defined by RouteInterface interface. * factory(): defined by RouteInterface interface.
* *
* @see Route::factory() * @see Route::factory()
* @param array|\Traversable $options * @param array|Traversable $options
* @throws \Zend\Mvc\Router\Exception\InvalidArgumentException * @throws Exception\InvalidArgumentException
* @return Regex * @return Regex
*/ */
public static function factory($options = array()) public static function factory($options = array())
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Mvc/Router/Http/Scheme.php
Expand Up @@ -67,8 +67,8 @@ public function __construct($scheme, array $defaults = array())
* factory(): defined by RouteInterface interface. * factory(): defined by RouteInterface interface.
* *
* @see Route::factory() * @see Route::factory()
* @param array|\Traversable $options * @param array|Traversable $options
* @throws \Zend\Mvc\Router\Exception\InvalidArgumentException * @throws Exception\InvalidArgumentException
* @return Scheme * @return Scheme
*/ */
public static function factory($options = array()) public static function factory($options = array())
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Mvc/Router/Http/Segment.php
Expand Up @@ -91,7 +91,7 @@ public function __construct($route, array $constraints = array(), array $default
* *
* @see Route::factory() * @see Route::factory()
* @param array|Traversable $options * @param array|Traversable $options
* @throws \Zend\Mvc\Router\Exception\InvalidArgumentException * @throws Exception\InvalidArgumentException
* @return Segment * @return Segment
*/ */
public static function factory($options = array()) public static function factory($options = array())
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Mvc/Router/Http/TreeRouteStack.php
Expand Up @@ -96,7 +96,7 @@ public function addRoute($name, $route, $priority = null)
* routeFromArray(): defined by SimpleRouteStack. * routeFromArray(): defined by SimpleRouteStack.
* *
* @see SimpleRouteStack::routeFromArray() * @see SimpleRouteStack::routeFromArray()
* @param array|\Traversable $specs * @param array|Traversable $specs
* @return RouteInterface * @return RouteInterface
*/ */
protected function routeFromArray($specs) protected function routeFromArray($specs)
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Mvc/Router/Http/Wildcard.php
Expand Up @@ -84,7 +84,7 @@ public function __construct($keyValueDelimiter = '/', $paramDelimiter = '/', arr
* *
* @see Route::factory() * @see Route::factory()
* @param array|Traversable $options * @param array|Traversable $options
* @throws \Zend\Mvc\Router\Exception\InvalidArgumentException * @throws Exception\InvalidArgumentException
* @return Wildcard * @return Wildcard
*/ */
public static function factory($options = array()) public static function factory($options = array())
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Mvc/Router/SimpleRouteStack.php
Expand Up @@ -71,7 +71,7 @@ public function __construct()
* factory(): defined by RouteInterface interface. * factory(): defined by RouteInterface interface.
* *
* @see Route::factory() * @see Route::factory()
* @param array|\Traversable $options * @param array|Traversable $options
* @return SimpleRouteStack * @return SimpleRouteStack
* @throws Exception\InvalidArgumentException * @throws Exception\InvalidArgumentException
*/ */
Expand Down Expand Up @@ -135,7 +135,7 @@ public function routeBroker()
* addRoutes(): defined by RouteStackInterface interface. * addRoutes(): defined by RouteStackInterface interface.
* *
* @see RouteStack::addRoutes() * @see RouteStack::addRoutes()
* @param array|\Traversable $routes * @param array|Traversable $routes
* @return SimpleRouteStack * @return SimpleRouteStack
* @throws Exception\InvalidArgumentException * @throws Exception\InvalidArgumentException
*/ */
Expand Down
3 changes: 2 additions & 1 deletion library/Zend/Mvc/Service/RouterFactory.php
Expand Up @@ -21,6 +21,7 @@


namespace Zend\Mvc\Service; namespace Zend\Mvc\Service;


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


namespace Zend\Mvc\Service; namespace Zend\Mvc\Service;


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

0 comments on commit dbf4614

Please sign in to comment.