Passed
Push — master ( d4ea0f...8cb5b2 )
by Christopher
04:24
created

Aggs   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 27
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addAggregation() 0 3 1
A getAggregations() 0 3 1
1
<?php
0 ignored issues
show
Coding Style introduced by
This file is missing a doc comment.
Loading history...
Coding Style introduced by
The PHP open tag does not have a corresponding PHP close tag
Loading history...
Coding Style introduced by
Filename "Aggs.php" doesn't match the expected filename "aggs.php"
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...
Coding Style introduced by
Short array syntax is not allowed
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
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
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
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
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