From d96d90f90496268b4266fccea29e881353526c22 Mon Sep 17 00:00:00 2001 From: Andrew Caya Date: Mon, 23 May 2016 14:21:22 -0400 Subject: [PATCH 1/3] Updated all references to the deprecated Zend\Stdlib\Hydrator classes. --- Module.php | 3 +-- .../classes/PhlyRestfully.Metadata.html | 8 +++---- .../PhlyRestfully.Plugin.HalLinks.html | 12 +++++----- docs/api/phpdoc/structure.xml | 24 +++++++++---------- docs/ref/metadata-map.rst | 2 +- src/PhlyRestfully/Metadata.php | 4 ++-- src/PhlyRestfully/MetadataMap.php | 2 +- src/PhlyRestfully/Plugin/HalLinks.php | 4 ++-- .../View/RestfulJsonRenderer.php | 2 +- 9 files changed, 30 insertions(+), 31 deletions(-) diff --git a/Module.php b/Module.php index 34c0996a..713cb5f4 100644 --- a/Module.php +++ b/Module.php @@ -8,8 +8,7 @@ namespace PhlyRestfully; -use Zend\Stdlib\Hydrator\HydratorInterface; -use Zend\Stdlib\Hydrator\HydratorPluginManager; +use Zend\Hydrator\HydratorPluginManager; /** * ZF2 module diff --git a/docs/api/phpdoc/classes/PhlyRestfully.Metadata.html b/docs/api/phpdoc/classes/PhlyRestfully.Metadata.html index 6dbca9cc..e32b39ff 100644 --- a/docs/api/phpdoc/classes/PhlyRestfully.Metadata.html +++ b/docs/api/phpdoc/classes/PhlyRestfully.Metadata.html @@ -135,13 +135,13 @@

Returns

Retrieve the hydrator to associate with this class, if any

-
getHydrator() : null | \Zend\Stdlib\Hydrator\HydratorInterface
+
getHydrator() : null | \Zend\Hydrator\HydratorInterface

Returns

-null\Zend\Stdlib\Hydrator\HydratorInterface +null\Zend\Hydrator\HydratorInterface
@@ -253,7 +253,7 @@

Returns

Set the hydrator to use with this class

-
setHydrator(string | \Zend\Stdlib\Hydrator\HydratorInterface $hydrator) : \PhlyRestfully\Metadata
+
setHydrator(string | \Zend\Hydrator\HydratorInterface $hydrator) : \PhlyRestfully\Metadata
@@ -264,7 +264,7 @@

Set the hydrator to use with this class

Parameters

$hydrator

-string\Zend\Stdlib\Hydrator\HydratorInterface +string\Zend\Hydrator\HydratorInterface

Exceptions

diff --git a/docs/api/phpdoc/classes/PhlyRestfully.Plugin.HalLinks.html b/docs/api/phpdoc/classes/PhlyRestfully.Plugin.HalLinks.html index b0df9e79..f4fc32ea 100644 --- a/docs/api/phpdoc/classes/PhlyRestfully.Plugin.HalLinks.html +++ b/docs/api/phpdoc/classes/PhlyRestfully.Plugin.HalLinks.html @@ -110,7 +110,7 @@

 Methods

Map a resource class to a specific hydrator instance

-
addHydrator(string $class, \Zend\Stdlib\Hydrator\HydratorInterface $hydrator) : \PhlyRestfully\Plugin\RestfulJsonRenderer
+
addHydrator(string $class, \Zend\Hydrator\HydratorInterface $hydrator) : \PhlyRestfully\Plugin\RestfulJsonRenderer
@@ -121,7 +121,7 @@

$class

$hydrator

-\Zend\Stdlib\Hydrator\HydratorInterface +\Zend\Hydrator\HydratorInterface

Returns

\PhlyRestfully\Plugin\RestfulJsonRenderer
@@ -288,7 +288,7 @@

Returns

Retrieve a hydrator for a given resource

-
getHydratorForResource(object $resource) : \Zend\Stdlib\Hydrator\HydratorInterface | false
+
getHydratorForResource(object $resource) : \Zend\Hydrator\HydratorInterface | false

If the resource has a mapped hydrator, returns that hydrator. If not, and @@ -301,7 +301,7 @@

$resource

Returns

-\Zend\Stdlib\Hydrator\HydratorInterfacefalse +\Zend\Hydrator\HydratorInterfacefalse
@@ -410,14 +410,14 @@

$controller

Set the default hydrator to use if none specified for a class.

-
setDefaultHydrator(\Zend\Stdlib\Hydrator\HydratorInterface $hydrator) : \PhlyRestfully\Plugin\RestfulJsonRenderer
+
setDefaultHydrator(\Zend\Hydrator\HydratorInterface $hydrator) : \PhlyRestfully\Plugin\RestfulJsonRenderer

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/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; From 7a9e545c9ee9de18ec48c1f84807715f9594ac2d Mon Sep 17 00:00:00 2001 From: Andrew Caya Date: Mon, 23 May 2016 14:23:04 -0400 Subject: [PATCH 2/3] Modified a method declaration for consistency. --- src/PhlyRestfully/ResourceController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhlyRestfully/ResourceController.php b/src/PhlyRestfully/ResourceController.php index bc8498ce..988a5ec1 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); From b8ac819fb944d7d220e8c5c4b5c4b65144f4b024 Mon Sep 17 00:00:00 2001 From: Andrew Caya Date: Mon, 23 May 2016 14:24:54 -0400 Subject: [PATCH 3/3] Replaced all occurrences of the EventManager's triggerUntil method (deprecated) with its trigger method. --- src/PhlyRestfully/Resource.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/PhlyRestfully/Resource.php b/src/PhlyRestfully/Resource.php index 9a35d6be..5f894701 100644 --- a/src/PhlyRestfully/Resource.php +++ b/src/PhlyRestfully/Resource.php @@ -188,7 +188,7 @@ public function create($data) $events = $this->getEventManager(); $event = $this->prepareEvent(__FUNCTION__, array('data' => $data)); - $results = $events->triggerUntil($event, function($result) { + $results = $events->trigger($event, function($result) { return $result instanceof ApiProblem; }); $last = $results->last(); @@ -229,7 +229,7 @@ public function update($id, $data) $events = $this->getEventManager(); $event = $this->prepareEvent(__FUNCTION__, compact('id', 'data')); - $results = $events->triggerUntil($event, function($result) { + $results = $events->trigger($event, function($result) { return $result instanceof ApiProblem; }); $last = $results->last(); @@ -278,7 +278,7 @@ public function replaceList($data) }); $events = $this->getEventManager(); $event = $this->prepareEvent(__FUNCTION__, array('data' => $data)); - $results = $events->triggerUntil($event, function($result) { + $results = $events->trigger($event, function($result) { return $result instanceof ApiProblem; }); $last = $results->last(); @@ -320,7 +320,7 @@ public function patch($id, $data) $events = $this->getEventManager(); $event = $this->prepareEvent(__FUNCTION__, compact('id', 'data')); - $results = $events->triggerUntil($event, function($result) { + $results = $events->trigger($event, function($result) { return $result instanceof ApiProblem; }); $last = $results->last(); @@ -344,7 +344,7 @@ public function delete($id) { $events = $this->getEventManager(); $event = $this->prepareEvent(__FUNCTION__, array('id' => $id)); - $results = $events->triggerUntil($event, function($result) { + $results = $events->trigger($event, function($result) { return $result instanceof ApiProblem; }); $last = $results->last(); @@ -373,7 +373,7 @@ public function deleteList($data = null) } $events = $this->getEventManager(); $event = $this->prepareEvent(__FUNCTION__, array('data' => $data)); - $results = $events->triggerUntil($event, function($result) { + $results = $events->trigger($event, function($result) { return $result instanceof ApiProblem; }); $last = $results->last(); @@ -398,7 +398,7 @@ public function fetch($id) { $events = $this->getEventManager(); $event = $this->prepareEvent(__FUNCTION__, array('id' => $id)); - $results = $events->triggerUntil($event, function($result) { + $results = $events->trigger($event, function($result) { return $result instanceof ApiProblem; }); $last = $results->last(); @@ -426,7 +426,7 @@ public function fetchAll() $events = $this->getEventManager(); $params = func_get_args(); $event = $this->prepareEvent(__FUNCTION__, $params); - $results = $events->triggerUntil($event, function($result) { + $results = $events->trigger($event, function($result) { return $result instanceof ApiProblem; }); $last = $results->last();