From de17c854e17ad577b50dc6f2ac3c7b0e916e7f3b Mon Sep 17 00:00:00 2001
From: Niels Nijens <nijens.niels@gmail.com>
Date: Wed, 21 Sep 2016 15:51:54 +0200
Subject: [PATCH] Fix notice in BoolQuery::getQueries when nothing is added to
 bool type

---
 src/Query/BoolQuery.php | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/Query/BoolQuery.php b/src/Query/BoolQuery.php
index 51a0be0..55bd94a 100644
--- a/src/Query/BoolQuery.php
+++ b/src/Query/BoolQuery.php
@@ -42,7 +42,10 @@ class BoolQuery implements BuilderInterface
     }
 
     /**
-     * @param  null $boolType
+     * Returns the query instances (by bool type).
+     *
+     * @param  string|null $boolType
+     *
      * @return array
      */
     public function getQueries($boolType = null)
@@ -57,7 +60,11 @@ class BoolQuery implements BuilderInterface
             return $queries;
         }
 
-        return $this->container[$boolType];
+        if (isset($this->container[$boolType])) {
+            return $this->container[$boolType];
+        }
+
+        return [];
     }
 
     /**
-- 
GitLab