Completed
Push — master ( 335120...ad531e )
by Alessandro
9s
created

InfluxDbEvent   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 40
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getPoints() 0 4 1
A getPrecision() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Algatux\InfluxDbBundle\Events;
6
7
use InfluxDB\Point;
8
use Symfony\Component\EventDispatcher\Event;
9
10
/**
11
 * Class InfluxDbEvent.
12
 */
13
abstract class InfluxDbEvent extends Event
14
{
15
    const NAME = 'influxdb.points_collected';
16
17
    /**
18
     * @var Point[]
19
     */
20
    protected $points;
21
22
    /**
23
     * @var string
24
     */
25
    protected $precision;
26
27
    /**
28
     * @param Point[] $points
29
     * @param string  $precision
30
     */
31 5
    public function __construct(array $points, string $precision)
32
    {
33 5
        $this->points = $points;
34 5
        $this->precision = $precision;
35 5
    }
36
37
    /**
38
     * @return Point[]
39
     */
40 5
    final public function getPoints(): array
41
    {
42 5
        return $this->points;
43
    }
44
45
    /**
46
     * @return string
47
     */
48 5
    final public function getPrecision()
49
    {
50 5
        return $this->precision;
51
    }
52
}
53