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

Commit 9e103a9

Browse files
committed
Merge branch 'hotfix/7672'
Close #69 Fixes zendframework/zend-mvc#7672
2 parents eed620c + 853e4b2 commit 9e103a9

File tree

5 files changed

+60
-6
lines changed

5 files changed

+60
-6
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ matrix:
2323
- php: 7
2424
- php: hhvm
2525
allow_failures:
26-
- php: 7
2726
- php: hhvm
2827

2928
notifications:

CHANGELOG.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
All notable changes to this project will be documented in this file, in reverse chronological order by release.
44

5-
## 2.6.1 - TBD
5+
## 2.6.1 - 2016-02-16
66

77
### Added
88

@@ -18,7 +18,17 @@ All notable changes to this project will be documented in this file, in reverse
1818

1919
### Fixed
2020

21-
- Nothing.
21+
- [#69](https://github.com/zendframework/zend-mvc/pull/69) largely reverts
22+
[#30](https://github.com/zendframework/zend-mvc/pull/30), having the component
23+
utilize the `HydratorPluginManager` from zend-stdlib 2.7.5. This was done to
24+
provide backwards compatibility; while zend-stdlib Hydrator types can be used
25+
in place of zend-hydrator types, the reverse is not true.
26+
27+
You can make your code forwards-compatible with version 3, where the
28+
`HydratorPluginManager` will be pulled from zend-hydrator, by updating your
29+
typehints to use the zend-hydrator classes instead of those from zend-stdlib;
30+
the instances returned from the zend-stdlib `HydratorPluginManager`, because
31+
they extend those from zend-hydrator, remain compatible.
2232

2333
## 2.6.0 - 2015-09-22
2434

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
}
1414
},
1515
"require": {
16-
"php": ">=5.5",
16+
"php": "^5.5 || ^7.0",
1717
"zendframework/zend-eventmanager": "~2.5",
1818
"zendframework/zend-servicemanager": "~2.5",
1919
"zendframework/zend-hydrator": "~1.0",
2020
"zendframework/zend-form": "~2.6",
21-
"zendframework/zend-stdlib": "~2.7"
21+
"zendframework/zend-stdlib": "^2.7.5"
2222
},
2323
"require-dev": {
2424
"zendframework/zend-authentication": "~2.5",

src/Service/HydratorManagerFactory.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@
1111

1212
class HydratorManagerFactory extends AbstractPluginManagerFactory
1313
{
14-
const PLUGIN_MANAGER_CLASS = 'Zend\Hydrator\HydratorPluginManager';
14+
/**
15+
* @todo Switch to Zend\Hydrator\HydratorPluginManager for 3.0 (if kept)
16+
*/
17+
const PLUGIN_MANAGER_CLASS = 'Zend\Stdlib\Hydrator\HydratorPluginManager';
1518
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
/**
3+
* Zend Framework (http://framework.zend.com/)
4+
*
5+
* @link http://github.com/zendframework/zf2 for the canonical source repository
6+
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
7+
* @license http://framework.zend.com/license/new-bsd New BSD License
8+
*/
9+
10+
namespace ZendTest\Mvc\Service;
11+
12+
use PHPUnit_Framework_TestCase as TestCase;
13+
use Zend\Hydrator\HydratorPluginManager as ZendHydratorManager;
14+
use Zend\Mvc\Service\HydratorManagerFactory;
15+
use Zend\ServiceManager\ServiceLocatorInterface;
16+
use Zend\Stdlib\Hydrator\HydratorPluginManager;
17+
18+
class HydratorManagerFactoryTest extends TestCase
19+
{
20+
public function setUp()
21+
{
22+
$this->factory = new HydratorManagerFactory();
23+
$this->services = $this->prophesize(ServiceLocatorInterface::class);
24+
$this->services->get('Config')->willReturn([]);
25+
}
26+
27+
public function testFactoryReturnsZendHydratorManagerInstance()
28+
{
29+
$hydrators = $this->factory->createService($this->services->reveal());
30+
$this->assertInstanceOf(ZendHydratorManager::class, $hydrators);
31+
return $hydrators;
32+
}
33+
34+
/**
35+
* @todo Remove for 3.0
36+
* @depends testFactoryReturnsZendHydratorManagerInstance
37+
*/
38+
public function testFactoryReturnsStdlibHydratorManagerInstance($hydrators)
39+
{
40+
$this->assertInstanceOf(HydratorPluginManager::class, $hydrators);
41+
}
42+
}

0 commit comments

Comments
 (0)