From 64fa26e3d9fa38b9fdda1280a72bf5f820046fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michae=CC=88l=20Perrin?= Date: Wed, 17 Dec 2014 12:44:57 +0100 Subject: [PATCH] Fix PHP notice when using indexes without defined types --- Configuration/Source/ContainerSource.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Configuration/Source/ContainerSource.php b/Configuration/Source/ContainerSource.php index 8d094c7..da77009 100644 --- a/Configuration/Source/ContainerSource.php +++ b/Configuration/Source/ContainerSource.php @@ -41,13 +41,16 @@ class ContainerSource implements SourceInterface $indexes = array(); foreach ($this->configArray as $config) { $types = array(); - foreach ($config['types'] as $typeConfig) { - $types[$typeConfig['name']] = new TypeConfig( - $typeConfig['name'], - $typeConfig['mapping'], - $typeConfig['config'] - ); - // TODO: handle prototypes.. + + if (isset($config['types'])) { + foreach ($config['types'] as $typeConfig) { + $types[$typeConfig['name']] = new TypeConfig( + $typeConfig['name'], + $typeConfig['mapping'], + $typeConfig['config'] + ); + // TODO: handle prototypes.. + } } $index = new IndexConfig($config['name'], $types, array(