Completed
Push — master ( c23418...5492c9 )
by Alessandro
7s
created

AbstractInfluxDbEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 3
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 AbstractInfluxDbEvent.
12
 */
13
abstract class AbstractInfluxDbEvent extends Event
14
{
15
    const NAME = 'influxdb.points_collected';
16
17
    /**
18
     * @var Point[]
19
     */
20
    private $points;
21
22
    /**
23
     * @var string
24
     */
25
    private $precision;
26
27
    /**
28
     * @var string|null
29
     */
30
    private $connection;
31
32
    /**
33
     * @param Point[] $points
34
     * @param string  $precision
35
     * @param string  $connection
36
     */
37
    public function __construct(array $points, string $precision, string $connection = null)
38
    {
39
        $this->points = $points;
40
        $this->precision = $precision;
41
        $this->connection = $connection;
42
    }
43
44
    /**
45
     * @return Point[]
46
     */
47
    final public function getPoints(): array
48
    {
49
        return $this->points;
50
    }
51
52
    /**
53
     * @return string
54
     */
55
    final public function getPrecision()
56
    {
57
        return $this->precision;
58
    }
59
60
    /**
61
     * @return string|null
62
     */
63
    final public function getConnection()
64
    {
65
        return $this->connection;
66
    }
67
}
68