Completed
Pull Request — master (#29)
by Alessandro
07:48
created

AbstractInfluxDbEvent::isWriteDeferred()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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
    /** @var Point[] */
18
    protected $points;
19
20
    /** @var string */
21
    private $collectionPrecision;
22
    /**
23
     * @var bool
24
     */
25
    private $deferred;
26
27
    /**
28
     * AbstractInfluxDbEvent constructor.
29
     *
30
     * @param Point[]   $collection
31
     * @param string    $collectionPrecision
32
     * @param bool      $deferred
33
     */
34
    public function __construct(array $collection, string $collectionPrecision, bool $deferred = false)
35
    {
36
        $this->points = $collection;
37
        $this->collectionPrecision = $collectionPrecision;
38
        $this->deferred = $deferred;
39
    }
40
41
    /**
42
     * @return string
43
     */
44
    public function getCollectionPrecision(): string
45
    {
46
        return $this->collectionPrecision;
47
    }
48
49
    /**
50
     * @return Point[]
51
     */
52
    public function getPoints(): array
53
    {
54
        return $this->points;
55
    }
56
57
    /**
58
     * @return bool
59
     */
60
    public function isWriteDeferred(): bool
61
    {
62
        return $this->deferred;
63
    }
64
}
65