Parameters
$hydrator
-\Zend\Stdlib\Hydrator\HydratorInterface
+\Zend\Hydrator\HydratorInterface
Returns
\PhlyRestfully\Plugin\RestfulJsonRenderer
diff --git a/docs/api/phpdoc/structure.xml b/docs/api/phpdoc/structure.xml
index ab64133b..d7c752a7 100644
--- a/docs/api/phpdoc/structure.xml
+++ b/docs/api/phpdoc/structure.xml
@@ -1327,9 +1327,9 @@ underscores.</p>
Retrieve the hydrator to associate with this class, if any
-
+
null
- \Zend\Stdlib\Hydrator\HydratorInterface
+ \Zend\Hydrator\HydratorInterface
@@ -1452,9 +1452,9 @@ underscores.</p>
Set the hydrator to use with this class
-
+
string
- \Zend\Stdlib\Hydrator\HydratorInterface
+ \Zend\Hydrator\HydratorInterface
self
@@ -3691,8 +3691,8 @@ replaced with a RestfulJsonModel containing an API-Problem payload.</p>
string
-
- \Zend\Stdlib\Hydrator\HydratorInterface
+
+ \Zend\Hydrator\HydratorInterface
\PhlyRestfully\Plugin\RestfulJsonRenderer
@@ -3706,7 +3706,7 @@ replaced with a RestfulJsonModel containing an API-Problem payload.</p>
$hydrator
- \Zend\Stdlib\Hydrator\HydratorInterface
+ \Zend\Hydrator\HydratorInterface
@@ -3715,8 +3715,8 @@ replaced with a RestfulJsonModel containing an API-Problem payload.</p>
Set the default hydrator to use if none specified for a class.
-
- \Zend\Stdlib\Hydrator\HydratorInterface
+
+ \Zend\Hydrator\HydratorInterface
\PhlyRestfully\Plugin\RestfulJsonRenderer
@@ -3725,7 +3725,7 @@ replaced with a RestfulJsonModel containing an API-Problem payload.</p>
$hydrator
- \Zend\Stdlib\Hydrator\HydratorInterface
+ \Zend\Hydrator\HydratorInterface
@@ -3739,8 +3739,8 @@ Otherwise, a boolean false is returned.</p>
object
-
- \Zend\Stdlib\Hydrator\HydratorInterface
+
+ \Zend\Hydrator\HydratorInterface
false
diff --git a/docs/ref/metadata-map.rst b/docs/ref/metadata-map.rst
index 74b30d30..da400e02 100644
--- a/docs/ref/metadata-map.rst
+++ b/docs/ref/metadata-map.rst
@@ -59,7 +59,7 @@ Metadata options
The following options are available for metadata maps:
- **hydrator**: the fully qualified class name of a hydrator, or a service name
- ``Zend\Stdlib\Hydrator\HydratorPluginManager`` recognizes, to use to extract
+ ``Zend\Hydrator\HydratorPluginManager`` recognizes, to use to extract
the resource. (**OPTIONAL**)
- **identifier_name**: the resource parameter corresponding to the identifier;
defaults to "id". (**OPTIONAL**)
diff --git a/src/PhlyRestfully/Metadata.php b/src/PhlyRestfully/Metadata.php
index ef77f8e5..0a7e8853 100644
--- a/src/PhlyRestfully/Metadata.php
+++ b/src/PhlyRestfully/Metadata.php
@@ -8,8 +8,8 @@
namespace PhlyRestfully;
-use Zend\Stdlib\Hydrator\HydratorInterface;
-use Zend\Stdlib\Hydrator\HydratorPluginManager;
+use Zend\Hydrator\HydratorInterface;
+use Zend\Hydrator\HydratorPluginManager;
class Metadata
{
diff --git a/src/PhlyRestfully/MetadataMap.php b/src/PhlyRestfully/MetadataMap.php
index 7f9e8e36..321cc82b 100644
--- a/src/PhlyRestfully/MetadataMap.php
+++ b/src/PhlyRestfully/MetadataMap.php
@@ -8,7 +8,7 @@
namespace PhlyRestfully;
-use Zend\Stdlib\Hydrator\HydratorPluginManager;
+use Zend\Hydrator\HydratorPluginManager;
class MetadataMap
{
diff --git a/src/PhlyRestfully/Plugin/HalLinks.php b/src/PhlyRestfully/Plugin/HalLinks.php
index 2b191f0a..2a72e73a 100644
--- a/src/PhlyRestfully/Plugin/HalLinks.php
+++ b/src/PhlyRestfully/Plugin/HalLinks.php
@@ -25,8 +25,8 @@
use Zend\Paginator\Paginator;
use Zend\Stdlib\ArrayUtils;
use Zend\Stdlib\DispatchableInterface;
-use Zend\Stdlib\Hydrator\HydratorInterface;
-use Zend\Stdlib\Hydrator\HydratorPluginManager;
+use Zend\Hydrator\HydratorInterface;
+use Zend\Hydrator\HydratorPluginManager;
use Zend\View\Helper\AbstractHelper;
use Zend\View\Helper\ServerUrl;
use Zend\View\Helper\Url;
diff --git a/src/PhlyRestfully/Resource.php b/src/PhlyRestfully/Resource.php
index 9a35d6be..70477c31 100644
--- a/src/PhlyRestfully/Resource.php
+++ b/src/PhlyRestfully/Resource.php
@@ -188,9 +188,9 @@ public function create($data)
$events = $this->getEventManager();
$event = $this->prepareEvent(__FUNCTION__, array('data' => $data));
- $results = $events->triggerUntil($event, function($result) {
+ $results = $events->triggerEventUntil(function ($result) {
return $result instanceof ApiProblem;
- });
+ }, $event);
$last = $results->last();
if (!is_array($last) && !is_object($last)) {
return $data;
@@ -229,9 +229,9 @@ public function update($id, $data)
$events = $this->getEventManager();
$event = $this->prepareEvent(__FUNCTION__, compact('id', 'data'));
- $results = $events->triggerUntil($event, function($result) {
+ $results = $events->triggerEventUntil(function ($result) {
return $result instanceof ApiProblem;
- });
+ }, $event);
$last = $results->last();
if (!is_array($last) && !is_object($last)) {
return $data;
@@ -263,7 +263,7 @@ public function replaceList($data)
gettype($data)
));
}
- array_walk($data, function($value, $key) use(&$data) {
+ array_walk($data, function ($value, $key) use (&$data) {
if (is_array($value)) {
$data[$key] = (object) $value;
return;
@@ -278,9 +278,9 @@ public function replaceList($data)
});
$events = $this->getEventManager();
$event = $this->prepareEvent(__FUNCTION__, array('data' => $data));
- $results = $events->triggerUntil($event, function($result) {
+ $results = $events->triggerEventUntil(function ($result) {
return $result instanceof ApiProblem;
- });
+ }, $event);
$last = $results->last();
if (!is_array($last) && !is_object($last)) {
return $data;
@@ -320,9 +320,9 @@ public function patch($id, $data)
$events = $this->getEventManager();
$event = $this->prepareEvent(__FUNCTION__, compact('id', 'data'));
- $results = $events->triggerUntil($event, function($result) {
+ $results = $events->triggerEventUntil(function ($result) {
return $result instanceof ApiProblem;
- });
+ }, $event);
$last = $results->last();
if (!is_array($last) && !is_object($last)) {
return $data;
@@ -344,9 +344,9 @@ public function delete($id)
{
$events = $this->getEventManager();
$event = $this->prepareEvent(__FUNCTION__, array('id' => $id));
- $results = $events->triggerUntil($event, function($result) {
+ $results = $events->triggerEventUntil(function ($result) {
return $result instanceof ApiProblem;
- });
+ }, $event);
$last = $results->last();
if (!is_bool($last) && !$last instanceof ApiProblem) {
return false;
@@ -373,9 +373,9 @@ public function deleteList($data = null)
}
$events = $this->getEventManager();
$event = $this->prepareEvent(__FUNCTION__, array('data' => $data));
- $results = $events->triggerUntil($event, function($result) {
+ $results = $events->triggerEventUntil(function ($result) {
return $result instanceof ApiProblem;
- });
+ }, $event);
$last = $results->last();
if (!is_bool($last) && !$last instanceof ApiProblem) {
return false;
@@ -398,9 +398,9 @@ public function fetch($id)
{
$events = $this->getEventManager();
$event = $this->prepareEvent(__FUNCTION__, array('id' => $id));
- $results = $events->triggerUntil($event, function($result) {
+ $results = $events->triggerEventUntil(function ($result) {
return $result instanceof ApiProblem;
- });
+ }, $event);
$last = $results->last();
if (!is_array($last) && !is_object($last)) {
return false;
@@ -426,9 +426,9 @@ public function fetchAll()
$events = $this->getEventManager();
$params = func_get_args();
$event = $this->prepareEvent(__FUNCTION__, $params);
- $results = $events->triggerUntil($event, function($result) {
+ $results = $events->triggerEventUntil(function ($result) {
return $result instanceof ApiProblem;
- });
+ }, $event);
$last = $results->last();
if (!is_array($last)
&& !$last instanceof HalCollection
diff --git a/src/PhlyRestfully/ResourceController.php b/src/PhlyRestfully/ResourceController.php
index bc8498ce..f8167e48 100644
--- a/src/PhlyRestfully/ResourceController.php
+++ b/src/PhlyRestfully/ResourceController.php
@@ -389,7 +389,7 @@ public function delete($id)
return $response;
}
- public function deleteList()
+ public function deleteList($data = [])
{
if (!$this->isMethodAllowedForCollection()) {
return $this->createMethodNotAllowedResponse($this->collectionHttpOptions);
diff --git a/src/PhlyRestfully/View/RestfulJsonRenderer.php b/src/PhlyRestfully/View/RestfulJsonRenderer.php
index b91d839d..17e5e06c 100644
--- a/src/PhlyRestfully/View/RestfulJsonRenderer.php
+++ b/src/PhlyRestfully/View/RestfulJsonRenderer.php
@@ -15,7 +15,7 @@
use PhlyRestfully\LinkCollection;
use PhlyRestfully\Plugin\HalLinks;
use Zend\Paginator\Paginator;
-use Zend\Stdlib\Hydrator\HydratorInterface;
+use Zend\Hydrator\HydratorInterface;
use Zend\View\HelperPluginManager;
use Zend\View\Renderer\JsonRenderer;
diff --git a/test/Bootstrap.php b/test/Bootstrap.php
index 78338d0a..a7b8cb35 100644
--- a/test/Bootstrap.php
+++ b/test/Bootstrap.php
@@ -6,7 +6,7 @@
* @package PhlyRestfully
*/
-namespace PhlyRestfullyTest;
+namespace PhlyRestfullytest;
use Zend\Loader\AutoloaderFactory;
use RuntimeException;
diff --git a/test/PhlyRestfullyTest/CollectionIntegrationTest.php b/test/PhlyRestfullyTest/CollectionIntegrationTest.php
index 2f18989e..94a1f0a5 100644
--- a/test/PhlyRestfullyTest/CollectionIntegrationTest.php
+++ b/test/PhlyRestfullyTest/CollectionIntegrationTest.php
@@ -29,6 +29,7 @@
use Zend\View\HelperPluginManager;
use Zend\View\Helper\ServerUrl as ServerUrlHelper;
use Zend\View\Helper\Url as UrlHelper;
+use Zend\ServiceManager\Config;
/**
* @subpackage UnitTest
@@ -220,7 +221,7 @@ public function testCollectionLinksIncludeFullQueryString()
public function getServiceManager()
{
- $controllers = new ControllerManager();
+ $controllers = new ControllerManager(new Config());
$controllers->addAbstractFactory('PhlyRestfully\Factory\ResourceControllerFactory');
$services = new ServiceManager();
diff --git a/test/PhlyRestfullyTest/Factory/ResourceControllerFactoryTest.php b/test/PhlyRestfullyTest/Factory/ResourceControllerFactoryTest.php
index 9b55e97d..5611cdc7 100644
--- a/test/PhlyRestfullyTest/Factory/ResourceControllerFactoryTest.php
+++ b/test/PhlyRestfullyTest/Factory/ResourceControllerFactoryTest.php
@@ -12,13 +12,14 @@
use PHPUnit_Framework_TestCase as TestCase;
use Zend\Mvc\Controller\ControllerManager;
use Zend\ServiceManager\ServiceManager;
+use Zend\ServiceManager\Config;
class ResourceControllerFactoryTest extends TestCase
{
public function setUp()
{
$this->services = $services = new ServiceManager();
- $this->controllers = $controllers = new ControllerManager();
+ $this->controllers = $controllers = new ControllerManager(new Config());
$this->factory = $factory = new ResourceControllerFactory();
$controllers->addAbstractFactory($factory);
diff --git a/test/PhlyRestfullyTest/ModuleTest.php b/test/PhlyRestfullyTest/ModuleTest.php
index a951c297..8180f0e5 100644
--- a/test/PhlyRestfullyTest/ModuleTest.php
+++ b/test/PhlyRestfullyTest/ModuleTest.php
@@ -84,7 +84,7 @@ public function testJsonRendererFactoryInjectsDefaultHydratorIfPresentInConfig()
$helpers = $services->get('ViewHelperManager');
$plugin = $helpers->get('HalLinks');
- $this->assertAttributeInstanceOf('Zend\Stdlib\Hydrator\ObjectProperty', 'defaultHydrator', $plugin);
+ $this->assertAttributeInstanceOf('Zend\Hydrator\ObjectProperty', 'defaultHydrator', $plugin);
}
public function testJsonRendererFactoryInjectsHydratorMappingsIfPresentInConfig()
diff --git a/test/PhlyRestfullyTest/ResourceTest.php b/test/PhlyRestfullyTest/ResourceTest.php
index a37e492e..764ac45e 100644
--- a/test/PhlyRestfullyTest/ResourceTest.php
+++ b/test/PhlyRestfullyTest/ResourceTest.php
@@ -395,11 +395,11 @@ public function testEventTerminateIfApiProblemIsReturned($eventName, $args, $idI
{
$called = false;
- $this->events->attach($eventName, function() {
+ $this->events->attach($eventName, function () {
return new ApiProblem(400, 'Random error');
}, 10);
- $this->events->attach($eventName, function() use (&$called) {
+ $this->events->attach($eventName, function () use (&$called) {
$called = true;
}, 0);