diff --git a/CHANGELOG.md b/CHANGELOG.md index 71989f095e..c33ac84400 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ All notable changes to this project will be documented in this file, in reverse ### Added +- [#42](https://github.com/zendframework/zend-db/pull/42) updates the component + to use zend-hydrator for hydrator functionality; this provides forward + compatibility with zend-hydrator, and backwards compatibility with + hydrators from older versions of zend-stdlib. - [#15](https://github.com/zendframework/zend-db/pull/15) adds a new predicate, `Zend\Db\Sql\Predicate\NotBetween`, which can be invoked via `Sql` instances: `$sql->notBetween($field, $min, $max)`. diff --git a/composer.json b/composer.json index c49feec937..f1e445974f 100644 --- a/composer.json +++ b/composer.json @@ -14,18 +14,19 @@ }, "require": { "php": ">=5.5", - "zendframework/zend-stdlib": "~2.5" + "zendframework/zend-stdlib": "~2.7" }, "require-dev": { "zendframework/zend-eventmanager": "~2.5", + "zendframework/zend-hydrator": "~1.0", "zendframework/zend-mvc": "~2.5", "zendframework/zend-servicemanager": "~2.5", - "zendframework/zend-stdlib": ">=2.5.0,<2.7.0", "fabpot/php-cs-fixer": "1.7.*", "phpunit/PHPUnit": "~4.0" }, "suggest": { "zendframework/zend-eventmanager": "Zend\\EventManager component", + "zendframework/zend-hydrator": "Zend\\Hydrator component for using HydratingResultSets", "zendframework/zend-servicemanager": "Zend\\ServiceManager component" }, "minimum-stability": "dev", diff --git a/src/ResultSet/HydratingResultSet.php b/src/ResultSet/HydratingResultSet.php index a8e2013976..bcc6788e8e 100644 --- a/src/ResultSet/HydratingResultSet.php +++ b/src/ResultSet/HydratingResultSet.php @@ -10,8 +10,8 @@ namespace Zend\Db\ResultSet; use ArrayObject; -use Zend\Stdlib\Hydrator\ArraySerializable; -use Zend\Stdlib\Hydrator\HydratorInterface; +use Zend\Hydrator\ArraySerializable; +use Zend\Hydrator\HydratorInterface; class HydratingResultSet extends AbstractResultSet { diff --git a/test/ResultSet/HydratingResultSetTest.php b/test/ResultSet/HydratingResultSetTest.php index 803900b16a..17ecd30adf 100644 --- a/test/ResultSet/HydratingResultSetTest.php +++ b/test/ResultSet/HydratingResultSetTest.php @@ -10,6 +10,8 @@ namespace ZendTest\Db\ResultSet; use Zend\Db\ResultSet\HydratingResultSet; +use Zend\Hydrator\ArraySerializable; +use Zend\Hydrator\ClassMethods; class HydratingResultSetTest extends \PHPUnit_Framework_TestCase { @@ -38,7 +40,7 @@ public function testGetObjectPrototype() public function testSetHydrator() { $hydratingRs = new HydratingResultSet; - $this->assertSame($hydratingRs, $hydratingRs->setHydrator(new \Zend\Stdlib\Hydrator\ClassMethods())); + $this->assertSame($hydratingRs, $hydratingRs->setHydrator(new ClassMethods())); } /** @@ -47,7 +49,7 @@ public function testSetHydrator() public function testGetHydrator() { $hydratingRs = new HydratingResultSet; - $this->assertInstanceOf('Zend\Stdlib\Hydrator\ArraySerializable', $hydratingRs->getHydrator()); + $this->assertInstanceOf(ArraySerializable::class, $hydratingRs->getHydrator()); } /**