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

Patch phpdoc 1 #101

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/AbstractResourceListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ abstract class AbstractResourceListener implements ListenerAggregateInterface

/**
* Set the entity_class for the controller config calling this resource
*
* @param string $className
* @return self
*/
public function setEntityClass($className)
{
Expand Down
15 changes: 8 additions & 7 deletions src/Factory/RestControllerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Interop\Container\ContainerInterface;
use Zend\EventManager\Event;
use Zend\EventManager\ListenerAggregateInterface;
use Zend\Mvc\Controller\ControllerManager;
use Zend\ServiceManager\AbstractFactoryInterface;
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
use Zend\ServiceManager\Exception\ServiceNotFoundException;
Expand All @@ -34,7 +35,7 @@ class RestControllerFactory implements AbstractFactoryInterface
*
* Provided for backwards compatibility; proxies to canCreate().
*
* @param ContainerInterface $controllers
* @param ContainerInterface $container
* @param string $requestedName
* @return bool
*/
Expand Down Expand Up @@ -89,14 +90,14 @@ public function canCreate(ContainerInterface $container, $requestedName)
*
* Provided for backwards compatibility; proxies to canCreate().
*
* @param ServiceLocatorInterface $controllers
* @param ServiceLocatorInterface|ControllerManager $serviceLocator
* @param string $name
* @param string $requestedName
* @return bool
*/
public function canCreateServiceWithName(ServiceLocatorInterface $controllers, $name, $requestedName)
public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
{
$container = $controllers->getServiceLocator() ?: $controllers;
$container = $serviceLocator->getServiceLocator() ?: $serviceLocator;
return $this->canCreate($container, $requestedName);
}

Expand Down Expand Up @@ -179,15 +180,15 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o
*
* Provided for backwards compatibility; proxies to __invoke().
*
* @param ServiceLocatorInterface $controllers
* @param ServiceLocatorInterface|ControllerManager $serviceLocator
* @param string $name
* @param string $requestedName
* @return RestController
* @throws ServiceNotCreatedException if listener specified is not a ListenerAggregate
*/
public function createServiceWithName(ServiceLocatorInterface $controllers, $name, $requestedName)
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
{
$container = $controllers->getServiceLocator() ?: $controllers;
$container = $serviceLocator->getServiceLocator() ?: $serviceLocator;
return $this($container, $requestedName);
}

Expand Down
10 changes: 5 additions & 5 deletions src/Listener/OptionsListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ protected function normalizeMethods($methods)
/**
* Create the Allow header
*
* @param array $options
* @param Response $response
* @param array $options
* @param Response $response
*/
protected function createAllowHeader(array $options, Response $response)
{
Expand All @@ -136,7 +136,7 @@ protected function getOptionsResponse(MvcEvent $event, array $options)
}

/**
* Prepare a 405 response
* Prepare a 405 ('method not allowed') response
*
* @param MvcEvent $event
* @param array $options
Expand All @@ -145,7 +145,7 @@ protected function getOptionsResponse(MvcEvent $event, array $options)
protected function get405Response(MvcEvent $event, array $options)
{
$response = $this->getOptionsResponse($event, $options);
$response->setStatusCode(405, 'Method Not Allowed');
$response->setStatusCode(405);
return $response;
}

Expand All @@ -159,7 +159,7 @@ protected function get405Response(MvcEvent $event, array $options)
*
* @param mixed $config
* @param mixed $matches
* @return void
* @return array
*/
protected function getConfigForControllerAndMatches($config, $matches)
{
Expand Down
3 changes: 2 additions & 1 deletion src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace ZF\Rest;

use Zend\Loader\StandardAutoloader;
use Zend\Mvc\Application;
use Zend\Mvc\MvcEvent;

/**
Expand All @@ -33,6 +33,7 @@ public function getConfig()
*/
public function onBootstrap(MvcEvent $e)
{
/** @var Application $app */
$app = $e->getTarget();
$services = $app->getServiceManager();
$events = $app->getEventManager();
Expand Down
2 changes: 1 addition & 1 deletion src/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public function setEventManager(EventManagerInterface $events)
*
* Lazy-instantiates an EM instance if none provided.
*
* @return EventManagerInterface
* @return EventManagerInterface|EventManager
*/
public function getEventManager()
{
Expand Down
34 changes: 33 additions & 1 deletion src/ResourceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
namespace ZF\Rest;

use Zend\EventManager\EventManagerAwareInterface;
use Zend\InputFilter\InputFilterInterface;
use ZF\MvcAuth\Identity\IdentityInterface;

/**
* Interface describing operations for a given resource.
Expand Down Expand Up @@ -65,7 +67,7 @@ public function update($id, $data);
/**
* Update (replace) an existing collection of records
*
* @param array $data
* @param array|object $data
* @return array|object
*/
public function replaceList($data);
Expand All @@ -79,6 +81,14 @@ public function replaceList($data);
*/
public function patch($id, $data);

/**
* Partial update an existing collection of records
*
* @param array|object $data
* @return array|object
*/
public function patchList($data);

/**
* Delete an existing record
*
Expand Down Expand Up @@ -109,4 +119,26 @@ public function fetch($id);
* @return \Zend\Paginator\Paginator
*/
public function fetchAll();

/**
* @param null|IdentityInterface $identity
* @return self
*/
public function setIdentity(IdentityInterface $identity = null);

/**
* @return null|IdentityInterface
*/
public function getIdentity();

/**
* @param null|InputFilterInterface $inputFilter
* @return self
*/
public function setInputFilter(InputFilterInterface $inputFilter = null);

/**
* @return null|InputFilterInterface
*/
public function getInputFilter();
}