Completed
Push — master ( 61c032...c23418 )
by Alessandro
03:27
created

InfluxDbEvent::getConnection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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
    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 7
    public function __construct(array $points, string $precision, string $connection = null)
38
    {
39 7
        $this->points = $points;
40 7
        $this->precision = $precision;
41 7
        $this->connection = $connection;
42 7
    }
43
44
    /**
45
     * @return Point[]
46
     */
47 6
    final public function getPoints(): array
48
    {
49 6
        return $this->points;
50
    }
51
52
    /**
53
     * @return string
54
     */
55 6
    final public function getPrecision()
56
    {
57 6
        return $this->precision;
58
    }
59
60
    /**
61
     * @return string|null
62
     */
63 7
    final public function getConnection()
64
    {
65 7
        return $this->connection;
66
    }
67
}
68