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

Commit 235efb9

Browse files
weierophinneymichalbundyra
authored andcommitted
Cast ArrayObject to array
Default configuration in the skeleton is not an array, but an ArrayObject, which can cause typehints to fail. Cast it to an array after retrieval.
1 parent 985cff6 commit 235efb9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Container/ApplicationFactory.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace Zend\Expressive\Container;
99

10+
use ArrayObject;
1011
use Interop\Container\ContainerInterface;
1112
use SplPriorityQueue;
1213
use Zend\Diactoros\Response\EmitterInterface;
@@ -156,6 +157,7 @@ class ApplicationFactory
156157
public function __invoke(ContainerInterface $container)
157158
{
158159
$config = $container->has('config') ? $container->get('config') : [];
160+
$config = $config instanceof ArrayObject ? $config->getArrayCopy() : $config;
159161

160162
$router = $container->has(RouterInterface::class)
161163
? $container->get(RouterInterface::class)

0 commit comments

Comments
 (0)