ReconnectEventArgs::getFunction()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Adgoal\DBALFaultTolerance\Events\Args;
6
7
use Doctrine\Common\EventArgs;
8
9
/**
10
 * Class ReconnectEventArgs.
11
 */
12
class ReconnectEventArgs extends EventArgs
13
{
14
    /**
15
     * @var string
16
     */
17
    private $function;
18
19
    /**
20
     * @var int
21
     */
22
    private $attempt;
23
24
    /**
25
     * @var string
26
     */
27
    private $query;
28
29
    /**
30
     * @var mixed|null
31
     */
32
    private $args;
33
34
    /**
35
     * ReconnectEventArgs constructor.
36
     *
37
     * @param string $function
38
     * @param int    $attempt
39
     * @param string $query
40
     * @param mixed  $args
41
     */
42 3
    public function __construct($function, $attempt, $query, $args = null)
43
    {
44 3
        $this->function = $function;
45 3
        $this->attempt = $attempt;
46 3
        $this->query = $query;
47 3
        $this->args = $args;
48
    }
49
50
    /**
51
     * @return string
52
     */
53
    public function getFunction(): string
54
    {
55
        return $this->function;
56
    }
57
58
    /**
59
     * @return int
60
     */
61
    public function getAttempt(): int
62
    {
63
        return $this->attempt;
64
    }
65
66
    /**
67
     * @return string
68
     */
69
    public function getQuery(): string
70
    {
71
        return $this->query;
72
    }
73
74
    /**
75
     * @return mixed|null
76
     */
77
    public function getArgs()
78
    {
79
        return $this->args;
80
    }
81
}
82