Completed
Pull Request — master (#1804)
by Pierre
03:29
created

Composite::addSource()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Elastica\Aggregation;
4
5
class Composite extends AbstractAggregation
6
{
7
    /**
8
     * @return $this
9
     */
10
    public function setSize(int $size): self
11
    {
12
        return $this->setParam('size', $size);
13
    }
14
15
    /**
16
     * @return $this
17
     */
18
    public function addSource(AbstractAggregation $aggregation): self
19
    {
20
        return $this->addParam('sources', [$aggregation]);
21
    }
22
23
    /**
24
     * @return $this
25
     */
26
    public function addAfter(?array $checkpoint): self
27
    {
28
        return $this->setParam('after', $checkpoint);
29
    }
30
}
31