Completed
Pull Request — master (#1804)
by Pierre
02:39
created

Composite   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 26
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setSize() 0 4 1
A addSource() 0 4 1
A addAfter() 0 4 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