Passed
Branch master (8cb5b2)
by Christopher
04:33 queued 12s
created

Aggs::getAggregations()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
0 ignored issues
show
Coding Style introduced by
The PHP open tag does not have a corresponding PHP close tag
Loading history...
2
namespace Triadev\Leopard\Business\Dsl\Aggregation;
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
4
use ONGR\ElasticsearchDSL\Aggregation\AbstractAggregation;
5
6
abstract class Aggs
0 ignored issues
show
Coding Style Documentation introduced by
Missing class doc comment
Loading history...
7
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class Aggs
Loading history...
8
    /**
9
     * Aggregations
10
     *
11
     * @var array
12
     */
13
    private $aggregations = [];
1 ignored issue
show
Coding Style introduced by
Private member variable "aggregations" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style introduced by
Private member variable "aggregations" must be prefixed with an underscore
Loading history...
14
    
15
    /**
16
     * Add aggregation
17
     *
18
     * @param AbstractAggregation $agg
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
19
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
20 40
    protected function addAggregation(AbstractAggregation $agg)
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
21
    {
22 40
        $this->aggregations[] = $agg;
23 40
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end addAggregation()
Loading history...
24
    
25
    /**
26
     * Get aggregations
27
     *
28
     * @return array
29
     */
30 40
    public function getAggregations() : array
31
    {
32 40
        return $this->aggregations;
33
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end getAggregations()
Loading history...
34
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
35