fix travis build
[GitHub/Stricted/Domain-Control-Panel.git] / vendor / Zend / Mvc / Service / HttpViewManagerConfigTrait.php
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
4 *
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
9
10 namespace Zend\Mvc\Service;
11
12 use ArrayAccess;
13 use Interop\Container\ContainerInterface;
14
15 trait HttpViewManagerConfigTrait
16 {
17 /**
18 * Retrieve view_manager configuration, if present.
19 *
20 * @param ContainerInterface $container
21 * @return array
22 */
23 private function getConfig(ContainerInterface $container)
24 {
25 $config = $container->has('config') ? $container->get('config') : [];
26
27 if (isset($config['view_manager'])
28 && (is_array($config['view_manager'])
29 || $config['view_manager'] instanceof ArrayAccess
30 )
31 ) {
32 return $config['view_manager'];
33 }
34
35 return [];
36 }
37 }