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

Commit 12d280c

Browse files
committed
Merging develop to master in preparation for 2.6.0
2 parents cc1d5dc + 9ab3288 commit 12d280c

34 files changed

+1190
-678
lines changed

.travis.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,28 @@ matrix:
1717
- php: 5.5
1818
env:
1919
- EXECUTE_CS_CHECK=true
20+
- php: 5.5
21+
env:
22+
- ZEND_EVENTMANAGER_VERSION="^2.6.2"
23+
- ZEND_SERVICEMANAGER_VERSION="^2.7.5"
2024
- php: 5.6
2125
env:
2226
- EXECUTE_TEST_COVERALLS=true
27+
- php: 5.6
28+
env:
29+
- ZEND_EVENTMANAGER_VERSION="^2.6.2"
30+
- ZEND_SERVICEMANAGER_VERSION="^2.7.5"
31+
- php: 7
2332
- php: 7
33+
env:
34+
- ZEND_EVENTMANAGER_VERSION="^2.6.2"
35+
- ZEND_SERVICEMANAGER_VERSION="^2.7.5"
36+
- php: hhvm
2437
- php: hhvm
38+
env:
39+
- ZEND_EVENTMANAGER_VERSION="^2.6.2"
40+
- ZEND_SERVICEMANAGER_VERSION="^2.7.5"
2541
allow_failures:
26-
- php: 7
2742
- php: hhvm
2843

2944
notifications:
@@ -34,6 +49,11 @@ before_install:
3449
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
3550
- composer self-update
3651
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls ; fi
52+
- if [[ $ZEND_EVENTMANAGER_VERSION != '' ]]; then composer require --no-update "zendframework/zend-eventmanager:$ZEND_EVENTMANAGER_VERSION" ; fi
53+
- if [[ $ZEND_EVENTMANAGER_VERSION == '' ]]; then composer require --no-update "zendframework/zend-eventmanager:^3.0" ; fi
54+
- if [[ $ZEND_SERVICEMANAGER_VERSION != '' ]]; then composer require --dev --no-update "zendframework/zend-servicemanager:$ZEND_SERVICEMANAGER_VERSION" ; fi
55+
- if [[ $ZEND_SERVICEMANAGER_VERSION == '' ]]; then composer require --dev --no-update "zendframework/zend-servicemanager:^3.0.3" ; fi
56+
- if [[ $ZEND_SERVICEMANAGER_VERSION == '' ]]; then composer remove --dev --no-update zendframework/zend-mvc zendframework/zend-session ; fi
3757

3858
install:
3959
- travis_retry composer install --no-interaction --ignore-platform-reqs

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,36 @@
22

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

5+
## 2.6.0 - TBD
6+
7+
### Added
8+
9+
- [#8](https://github.com/zendframework/zend-view/pull/8) adds a new method to
10+
each of the `Breadcrumbs` and `Menu` navigation helpers,
11+
`renderPartialWithParams(array $params = [], $container = null, $partial = null)`.
12+
This method allows passing parameters to the navigation partial to render,
13+
just as you would when using the `partial()` view helper.
14+
15+
### Deprecated
16+
17+
- Nothing.
18+
19+
### Removed
20+
21+
- Nothing.
22+
23+
### Fixed
24+
25+
- [#15](https://github.com/zendframework/zend-view/pull/15),
26+
[#17](https://github.com/zendframework/zend-view/pull/17),
27+
[#35](https://github.com/zendframework/zend-view/pull/35), and
28+
[#42](https://github.com/zendframework/zend-view/pull/42) update the component
29+
to be forwards-compatible with the v3 releases of zend-eventmanager,
30+
zend-servicemanager, and zend-stdlib. The changes include:
31+
- changes to how events are triggered to ensure they continue working correctly.
32+
- updates to the plugin manager to be forwards-compatible.
33+
- updates to helper factories to be forwards-compatible.
34+
535
## 2.5.4 - TBD
636

737
### Added

composer.json

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,30 @@
1414
},
1515
"require": {
1616
"php": "^5.5 || ^7.0",
17-
"zendframework/zend-eventmanager": "~2.5",
18-
"zendframework/zend-loader": "~2.5",
19-
"zendframework/zend-stdlib": "~2.5"
17+
"zendframework/zend-eventmanager": "^2.6.2 || ^3.0",
18+
"zendframework/zend-loader": "^2.5",
19+
"zendframework/zend-stdlib": "^2.7 || ^3.0"
2020
},
2121
"require-dev": {
22-
"zendframework/zend-authentication": "~2.5",
23-
"zendframework/zend-cache": "~2.5",
24-
"zendframework/zend-config": "~2.5",
25-
"zendframework/zend-console": "~2.5",
26-
"zendframework/zend-escaper": "~2.5",
27-
"zendframework/zend-feed": "~2.5",
28-
"zendframework/zend-filter": "~2.5",
29-
"zendframework/zend-http": "~2.5",
30-
"zendframework/zend-i18n": "~2.5",
31-
"zendframework/zend-json": "~2.5",
32-
"zendframework/zend-log": "~2.5",
33-
"zendframework/zend-modulemanager": "~2.5",
34-
"zendframework/zend-mvc": "~2.5",
35-
"zendframework/zend-navigation": "~2.5",
36-
"zendframework/zend-paginator": "~2.5",
37-
"zendframework/zend-permissions-acl": "~2.5",
38-
"zendframework/zend-serializer": "~2.5",
39-
"zendframework/zend-servicemanager": "~2.5",
40-
"zendframework/zend-session": "dev-master",
41-
"zendframework/zend-uri": "~2.5",
22+
"zendframework/zend-authentication": "^2.5",
23+
"zendframework/zend-cache": "^2.6.1",
24+
"zendframework/zend-config": "^2.6",
25+
"zendframework/zend-console": "^2.6",
26+
"zendframework/zend-escaper": "^2.5",
27+
"zendframework/zend-feed": "^2.7",
28+
"zendframework/zend-filter": "^2.6.1",
29+
"zendframework/zend-http": "^2.5.4",
30+
"zendframework/zend-i18n": "^2.6",
31+
"zendframework/zend-json": "^2.6.1",
32+
"zendframework/zend-log": "^2.7",
33+
"zendframework/zend-mvc": "^2.6.1",
34+
"zendframework/zend-navigation": "^2.5",
35+
"zendframework/zend-paginator": "^2.5",
36+
"zendframework/zend-permissions-acl": "^2.6",
37+
"zendframework/zend-serializer": "^2.6.1",
38+
"zendframework/zend-session": "^2.5",
39+
"zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3",
40+
"zendframework/zend-uri": "^2.5",
4241
"fabpot/php-cs-fixer": "1.7.*",
4342
"phpunit/PHPUnit": "~4.0"
4443
},
@@ -62,7 +61,7 @@
6261
"extra": {
6362
"branch-alias": {
6463
"dev-master": "2.5-dev",
65-
"dev-develop": "2.6-dev"
64+
"dev-develop": "3.0-dev"
6665
}
6766
},
6867
"autoload-dev": {

src/Helper/FlashMessenger.php

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@
1010
namespace Zend\View\Helper;
1111

1212
use Zend\Mvc\Controller\Plugin\FlashMessenger as PluginFlashMessenger;
13-
use Zend\ServiceManager\ServiceLocatorAwareInterface;
14-
use Zend\ServiceManager\ServiceLocatorInterface;
1513
use Zend\I18n\View\Helper\AbstractTranslatorHelper;
1614

1715
/**
1816
* Helper to proxy the plugin flash messenger
1917
*/
20-
class FlashMessenger extends AbstractTranslatorHelper implements ServiceLocatorAwareInterface
18+
class FlashMessenger extends AbstractTranslatorHelper
2119
{
2220
/**
2321
* Default attributes for the open format tag
@@ -62,13 +60,6 @@ class FlashMessenger extends AbstractTranslatorHelper implements ServiceLocatorA
6260
*/
6361
protected $pluginFlashMessenger;
6462

65-
/**
66-
* Service locator
67-
*
68-
* @var ServiceLocatorInterface
69-
*/
70-
protected $serviceLocator;
71-
7263
/**
7364
* Returns the flash messenger plugin controller
7465
*
@@ -309,28 +300,6 @@ public function getPluginFlashMessenger()
309300
return $this->pluginFlashMessenger;
310301
}
311302

312-
/**
313-
* Set the service locator.
314-
*
315-
* @param ServiceLocatorInterface $serviceLocator
316-
* @return AbstractHelper
317-
*/
318-
public function setServiceLocator(ServiceLocatorInterface $serviceLocator)
319-
{
320-
$this->serviceLocator = $serviceLocator;
321-
return $this;
322-
}
323-
324-
/**
325-
* Get the service locator.
326-
*
327-
* @return ServiceLocatorInterface
328-
*/
329-
public function getServiceLocator()
330-
{
331-
return $this->serviceLocator;
332-
}
333-
334303
/**
335304
* Retrieve the escapeHtml helper
336305
*

src/Helper/Navigation.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
namespace Zend\View\Helper;
1111

1212
use Zend\Navigation\AbstractContainer;
13-
use Zend\ServiceManager\ServiceLocatorAwareInterface;
1413
use Zend\View\Exception;
1514
use Zend\View\Helper\Navigation\AbstractHelper as AbstractNavigationHelper;
1615
use Zend\View\Helper\Navigation\HelperInterface as NavigationHelper;
@@ -112,7 +111,7 @@ public function __call($method, array $arguments = [])
112111
// check if call should proxy to another helper
113112
$helper = $this->findHelper($method, false);
114113
if ($helper) {
115-
if ($helper instanceof ServiceLocatorAwareInterface && $this->getServiceLocator()) {
114+
if (method_exists($helper, 'setServiceLocator') && $this->getServiceLocator()) {
116115
$helper->setServiceLocator($this->getServiceLocator());
117116
}
118117
return call_user_func_array($helper, $arguments);

src/Helper/Navigation/AbstractHelper.php

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
namespace Zend\View\Helper\Navigation;
1111

12+
use Interop\Container\ContainerInterface;
1213
use RecursiveIteratorIterator;
1314
use Zend\EventManager\EventManager;
1415
use Zend\EventManager\EventManagerAwareInterface;
@@ -18,8 +19,6 @@
1819
use Zend\Navigation;
1920
use Zend\Navigation\Page\AbstractPage;
2021
use Zend\Permissions\Acl;
21-
use Zend\ServiceManager\ServiceLocatorAwareInterface;
22-
use Zend\ServiceManager\ServiceLocatorInterface;
2322
use Zend\View;
2423
use Zend\View\Exception;
2524

@@ -29,19 +28,13 @@
2928
abstract class AbstractHelper extends View\Helper\AbstractHtmlElement implements
3029
EventManagerAwareInterface,
3130
HelperInterface,
32-
ServiceLocatorAwareInterface,
3331
TranslatorAwareInterface
3432
{
3533
/**
3634
* @var EventManagerInterface
3735
*/
3836
protected $events;
3937

40-
/**
41-
* @var ServiceLocatorInterface
42-
*/
43-
protected $serviceLocator;
44-
4538
/**
4639
* AbstractContainer to operate on by default
4740
*
@@ -91,6 +84,11 @@ abstract class AbstractHelper extends View\Helper\AbstractHtmlElement implements
9184
*/
9285
protected $role;
9386

87+
/**
88+
* @var ContainerInterface
89+
*/
90+
protected $serviceLocator;
91+
9492
/**
9593
* Whether ACL should be used for filtering out pages
9694
*
@@ -260,7 +258,8 @@ protected function parseContainer(&$container = null)
260258
}
261259

262260
if (is_string($container)) {
263-
if (!$this->getServiceLocator()) {
261+
$services = $this->getServiceLocator();
262+
if (! $services) {
264263
throw new Exception\InvalidArgumentException(sprintf(
265264
'Attempted to set container with alias "%s" but no ServiceLocator was set',
266265
$container
@@ -269,16 +268,8 @@ protected function parseContainer(&$container = null)
269268

270269
/**
271270
* Load the navigation container from the root service locator
272-
*
273-
* The navigation container is probably located in Zend\ServiceManager\ServiceManager
274-
* and not in the View\HelperPluginManager. If the set service locator is a
275-
* HelperPluginManager, access the navigation container via the main service locator.
276271
*/
277-
$sl = $this->getServiceLocator();
278-
if ($sl instanceof View\HelperPluginManager) {
279-
$sl = $sl->getServiceLocator();
280-
}
281-
$container = $sl->get($container);
272+
$container = $services->get($container);
282273
return;
283274
}
284275

@@ -755,10 +746,12 @@ public function hasRole()
755746
/**
756747
* Set the service locator.
757748
*
758-
* @param ServiceLocatorInterface $serviceLocator
749+
* Used internally to pull named navigation containers to render.
750+
*
751+
* @param ContainerInterface $serviceLocator
759752
* @return AbstractHelper
760753
*/
761-
public function setServiceLocator(ServiceLocatorInterface $serviceLocator)
754+
public function setServiceLocator(ContainerInterface $serviceLocator)
762755
{
763756
$this->serviceLocator = $serviceLocator;
764757
return $this;
@@ -767,7 +760,9 @@ public function setServiceLocator(ServiceLocatorInterface $serviceLocator)
767760
/**
768761
* Get the service locator.
769762
*
770-
* @return ServiceLocatorInterface
763+
* Used internally to pull named navigation containers to render.
764+
*
765+
* @return ContainerInterface
771766
*/
772767
public function getServiceLocator()
773768
{

0 commit comments

Comments
 (0)