Options::jsonSerialize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
/**
4
 * @author    Flipbox Factory
5
 * @copyright Copyright (c) 2017, Flipbox Digital
6
 * @link      https://github.com/flipbox/queue/releases/latest
7
 * @license   https://github.com/flipbox/queue/blob/master/LICENSE
8
 */
9
10
namespace flipbox\queue\options;
11
12
/**
13
 * @author Flipbox Factory <[email protected]>
14
 * @since 1.0.0
15
 */
16
class Options implements OptionsInterface, \JsonSerializable
17
{
18
19
    private $delay = 0;
20
21
    /**
22
     * @inheritdoc
23
     */
24
    public function getDelay(): int
25
    {
26
        return $this->delay;
27
    }
28
29
    /**
30
     * @inheritdoc
31
     */
32
    public function setDelay(int $delay)
33
    {
34
        $this->delay = $delay;
35
        return $this;
36
    }
37
38
    /**
39
     * @inheritdoc
40
     */
41
    public function toConfig(): array
42
    {
43
        return [
44
            'delay' => $this->getDelay()
45
        ];
46
    }
47
48
    /**
49
     * @inheritdoc
50
     */
51
    public function jsonSerialize()
52
    {
53
        return $this->toConfig();
54
    }
55
}
56