SExporter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A data() 0 9 2
1
<?php
2
/**
3
 * Summary exporter
4
 * User: moyo
5
 * Date: 2018/5/18
6
 * Time: 11:38 AM
7
 */
8
9
namespace Carno\Monitor\Chips\Metrical;
10
11
trait SExporter
12
{
13
    /**
14
     * @return array
15
     */
16
    public function data() : array
17
    {
18
        $s = ['count' => $this->count, 'sum' => $this->sum];
19
20
        foreach ($this->quantiles as $quantile) {
21
            $s['quantiles'][] = [$quantile, $this->query($quantile)];
0 ignored issues
show
Bug introduced by
It seems like query() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

21
            $s['quantiles'][] = [$quantile, $this->/** @scrutinizer ignore-call */ query($quantile)];
Loading history...
22
        }
23
24
        return $s;
25
    }
26
}
27