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

Commit 0b064a7

Browse files
committed
Merge branch 'hotfix/634' into develop
Forward port #634
2 parents 29f593e + c728710 commit 0b064a7

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ All notable changes to this project will be documented in this file, in reverse
4444

4545
### Fixed
4646

47-
- Nothing.
47+
- [#634](https://github.com/zendframework/zend-expressive/pull/634) provides several minor performance and maintenance improvements.
4848

4949
## 3.1.0 - 2018-07-30
5050

src/Container/ApplicationConfigInjectionDelegator.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,13 @@ public function __invoke(ContainerInterface $container, string $serviceName, cal
5454
}
5555

5656
$config = $container->get('config');
57-
if (! isset($config['routes']) && ! isset($config['middleware_pipeline'])) {
58-
return $application;
59-
}
6057

61-
self::injectPipelineFromConfig($application, (array) $config);
62-
self::injectRoutesFromConfig($application, (array) $config);
58+
if (! empty($config['middleware_pipeline'])) {
59+
self::injectPipelineFromConfig($application, (array) $config);
60+
}
61+
if (! empty($config['routes'])) {
62+
self::injectRoutesFromConfig($application, (array) $config);
63+
}
6364

6465
return $application;
6566
}
@@ -172,7 +173,7 @@ public static function injectPipelineFromConfig(Application $application, array
172173
*/
173174
public static function injectRoutesFromConfig(Application $application, array $config) : void
174175
{
175-
if (! isset($config['routes']) || ! is_array($config['routes'])) {
176+
if (empty($config['routes']) || ! is_array($config['routes'])) {
176177
return;
177178
}
178179

0 commit comments

Comments
 (0)