Write   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 49
ccs 0
cts 15
cp 0
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A tags() 0 3 1
A handle() 0 6 1
1
<?php
2
/**
3
 * src/Jobs/Write.php.
4
 *
5
 * @author      Austin Heap <[email protected]>
6
 * @version     v0.1.7
7
 */
8
declare(strict_types=1);
9
10
namespace AustinHeap\Database\InfluxDb\Jobs;
11
12
use AustinHeap\Database\InfluxDb\InfluxDbServiceProvider;
13
14
/**
15
 * Class Write.
16
 */
17
class Write extends Job
18
{
19
    /**
20
     * @var string|array
21
     */
22
    public $payload = null;
23
24
    /**
25
     * @var array
26
     */
27
    public $parameters = null;
28
29
    /**
30
     * Write constructor.
31
     *
32
     * @param array        $parameters
33
     * @param string|array $payload
34
     */
35
    public function __construct(array $parameters, $payload)
36
    {
37
        $this->parameters = $parameters;
38
        $this->payload = $payload;
39
40
        parent::__construct(
41
            [
42
                'parameters' => $parameters,
43
                'payload'    => $payload,
44
            ]
45
        );
46
    }
47
48
    /**
49
     * @return void
50
     */
51
    public function handle()
52
    {
53
        InfluxDbServiceProvider::getInstance()
54
                               ->write(
0 ignored issues
show
Bug introduced by
The method write() does not exist on InfluxDB\Database. Did you maybe mean writePoints()? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

54
                               ->/** @scrutinizer ignore-call */ write(

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
55
                                   $this->parameters,
56
                                   $this->payload
57
                               );
58
    }
59
60
    /**
61
     * @return array
62
     */
63
    public function tags(): array
64
    {
65
        return [static::class.':1'];
66
    }
67
}
68