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

Commit

Permalink
Merge branch 'hotfix/634' into develop
Browse files Browse the repository at this point in the history
Forward port #634
  • Loading branch information
weierophinney committed Aug 28, 2018
2 parents 29f593e + c728710 commit 0b064a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ All notable changes to this project will be documented in this file, in reverse

### Fixed

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

## 3.1.0 - 2018-07-30

Expand Down
13 changes: 7 additions & 6 deletions src/Container/ApplicationConfigInjectionDelegator.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,13 @@ public function __invoke(ContainerInterface $container, string $serviceName, cal
}

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

self::injectPipelineFromConfig($application, (array) $config);
self::injectRoutesFromConfig($application, (array) $config);
if (! empty($config['middleware_pipeline'])) {
self::injectPipelineFromConfig($application, (array) $config);
}
if (! empty($config['routes'])) {
self::injectRoutesFromConfig($application, (array) $config);
}

return $application;
}
Expand Down Expand Up @@ -172,7 +173,7 @@ public static function injectPipelineFromConfig(Application $application, array
*/
public static function injectRoutesFromConfig(Application $application, array $config) : void
{
if (! isset($config['routes']) || ! is_array($config['routes'])) {
if (empty($config['routes']) || ! is_array($config['routes'])) {
return;
}

Expand Down

0 comments on commit 0b064a7

Please sign in to comment.