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

AbstractInfluxDbEvent   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 55
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getPoints() 0 4 1
A getPrecision() 0 4 1
A getConnection() 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 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