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

Commit ff1429b

Browse files
committed
Merge branch 'feature/remove-zend-navigation' into develop
Close #125
2 parents 6a28ebe + 77bfbe0 commit ff1429b

File tree

2 files changed

+4
-37
lines changed

2 files changed

+4
-37
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ for full details on how to migrate your v2 application.
9191
`FormElementManager`, `FormAnnotationBuilder`, and the
9292
`FormAbstractServiceFactory`. The functionality is now exposed directly by the
9393
zend-form component.
94+
- [#125](https://github.com/zendframework/zend-mvc/pull/125) removes the
95+
functionality from the `ViewHelperManager` factory for fetching configuration
96+
classes from other components and using them to configure the instance. In all
97+
cases, this is now done by the components themselves.
9498

9599
### Fixed
96100

src/Service/ViewHelperManagerFactory.php

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
use Interop\Container\ContainerInterface;
1313
use Zend\Router\RouteMatch;
14-
use Zend\ServiceManager\ConfigInterface;
1514
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
1615
use Zend\View\Helper as ViewHelper;
1716
use Zend\View\HelperPluginManager;
@@ -29,7 +28,6 @@ class ViewHelperManagerFactory extends AbstractPluginManagerFactory
2928
* @var array
3029
*/
3130
protected $defaultHelperMapClasses = [
32-
'Zend\Navigation\View\HelperConfig',
3331
];
3432

3533
/**
@@ -45,47 +43,12 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o
4543
$options['factories'] = isset($options['factories']) ? $options['factories'] : [];
4644
$plugins = parent::__invoke($container, $requestedName, $options);
4745

48-
// Configure default helpers from other components
49-
$plugins = $this->configureHelpers($plugins);
50-
5146
// Override plugin factories
5247
$plugins = $this->injectOverrideFactories($plugins, $container);
5348

5449
return $plugins;
5550
}
5651

57-
/**
58-
* Configure helpers from other components.
59-
*
60-
* Loops through the list of default helper configuration classes, and uses
61-
* each to configure the helper plugin manager.
62-
*
63-
* @param HelperPluginManager $plugins
64-
* @return HelperPluginManager
65-
*/
66-
private function configureHelpers(HelperPluginManager $plugins)
67-
{
68-
foreach ($this->defaultHelperMapClasses as $configClass) {
69-
if (! is_string($configClass) || ! class_exists($configClass)) {
70-
continue;
71-
}
72-
73-
$config = new $configClass();
74-
75-
if (! $config instanceof ConfigInterface) {
76-
throw new ServiceNotCreatedException(sprintf(
77-
'Invalid service manager configuration class provided; received "%s", expected class implementing %s',
78-
$configClass,
79-
ConfigInterface::class
80-
));
81-
}
82-
83-
$config->configureServiceManager($plugins);
84-
}
85-
86-
return $plugins;
87-
}
88-
8952
/**
9053
* Inject override factories into the plugin manager.
9154
*

0 commit comments

Comments
 (0)