SqliteFrequencyDistributionExpression::getValue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Insenseanalytics\NovaBarMetrics;
4
5
class SqliteFrequencyDistributionExpression extends FrequencyDistributionExpression
6
{
7
    /**
8
     * Get the value of the expression.
9
     *
10
     * @return array
11
     */
12
    public function getValue()
13
    {
14
        return [
15
            'range' => "(cast({$this->stepSize} * cast({$this->column}/{$this->stepSize} as int) as string) || ' - ' || 
16
				cast({$this->stepSize} * cast({$this->column}/{$this->stepSize} as int) + {$this->stepSize} - 1 as string))",
17
            'minVal' => "{$this->stepSize} * cast({$this->column}/{$this->stepSize} as int)",
18
        ];
19
    }
20
}
21