From 8288d1e48cfe3d992180b89cb39b2ca2567b0b13 Mon Sep 17 00:00:00 2001
From: tchiotludo <tchiotludo@users.noreply.github.com>
Date: Fri, 26 Aug 2016 14:51:43 +0200
Subject: [PATCH] Allow chaining of aggregation

---
 src/Aggregation/AbstractAggregation.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/Aggregation/AbstractAggregation.php b/src/Aggregation/AbstractAggregation.php
index 438335e..03b3694 100644
--- a/src/Aggregation/AbstractAggregation.php
+++ b/src/Aggregation/AbstractAggregation.php
@@ -76,6 +76,8 @@ abstract class AbstractAggregation implements BuilderInterface
      * Adds a sub-aggregation.
      *
      * @param AbstractAggregation $abstractAggregation
+     *
+     * @return $this
      */
     public function addAggregation(AbstractAggregation $abstractAggregation)
     {
@@ -84,6 +86,8 @@ abstract class AbstractAggregation implements BuilderInterface
         }
 
         $this->aggregations->add($abstractAggregation);
+        
+        return $this;
     }
 
     /**
-- 
GitLab