Skip to content

Commit 64fa26e

Browse files
Michaël Perrinmerk
authored andcommitted
Fix PHP notice when using indexes without defined types
1 parent c4a2858 commit 64fa26e

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

Configuration/Source/ContainerSource.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,16 @@ public function getConfiguration()
4141
$indexes = array();
4242
foreach ($this->configArray as $config) {
4343
$types = array();
44-
foreach ($config['types'] as $typeConfig) {
45-
$types[$typeConfig['name']] = new TypeConfig(
46-
$typeConfig['name'],
47-
$typeConfig['mapping'],
48-
$typeConfig['config']
49-
);
50-
// TODO: handle prototypes..
44+
45+
if (isset($config['types'])) {
46+
foreach ($config['types'] as $typeConfig) {
47+
$types[$typeConfig['name']] = new TypeConfig(
48+
$typeConfig['name'],
49+
$typeConfig['mapping'],
50+
$typeConfig['config']
51+
);
52+
// TODO: handle prototypes..
53+
}
5154
}
5255

5356
$index = new IndexConfig($config['name'], $types, array(

0 commit comments

Comments
 (0)