Job   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 11
dl 0
loc 44
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getId() 0 3 1
A getData() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Pheanstalk;
6
7
use Pheanstalk\Contract\JobIdInterface;
8
9
/**
10
 * A job in a beanstalkd server.
11
 */
12
class Job implements JobIdInterface
13
{
14
    public const STATUS_READY = 'ready';
15
    public const STATUS_RESERVED = 'reserved';
16
    public const STATUS_DELAYED = 'delayed';
17
    public const STATUS_BURIED = 'buried';
18
19
    /**
20
     * @var int
21
     */
22
    private $id;
23
    /**
24
     * @var string
25
     */
26
    private $data;
27
28
    /**
29
     * @param int    $id   The job ID
30
     * @param string $data The job data
31
     */
32 18
    public function __construct(int $id, string $data)
33
    {
34 18
        $this->id = $id;
35 18
        $this->data = $data;
36 18
    }
37
38
    /**
39
     * The job ID, unique on the beanstalkd server.
40
     *
41
     * @return int
42
     */
43 16
    public function getId(): int
44
    {
45 16
        return $this->id;
46
    }
47
48
    /**
49
     * The job data.
50
     *
51
     * @return string
52
     */
53 7
    public function getData(): string
54
    {
55 7
        return $this->data;
56
    }
57
}
58