AbstractJob   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
eloc 9
dl 0
loc 50
c 0
b 0
f 0
ccs 10
cts 10
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setId() 0 5 1
A getId() 0 3 1
A setData() 0 5 1
A getData() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * TaskScheduler
7
 *
8
 * @author      Raffael Sahli <[email protected]>
9
 * @copyright   Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com)
10
 * @license     MIT https://opensource.org/licenses/MIT
11
 */
12
13
namespace TaskScheduler;
14
15
use MongoDB\BSON\ObjectId;
16
17
abstract class AbstractJob implements JobInterface
18
{
19
    /**
20
     * Data.
21
     *
22
     * @var mixed
23
     **/
24
    protected $data;
25
26
    /**
27
     * Job ID.
28
     *
29
     * @var ObjectId
30
     */
31
    protected $id;
32
33
    /**
34
     * {@inheritdoc}
35
     */
36 16
    public function setData($data): JobInterface
37
    {
38 16
        $this->data = $data;
39
40 16
        return $this;
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46 1
    public function getData()
47
    {
48 1
        return $this->data;
49
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54 16
    public function setId(ObjectId $id): JobInterface
55
    {
56 16
        $this->id = $id;
57
58 16
        return $this;
59
    }
60
61
    /**
62
     * {@inheritdoc}
63
     */
64 1
    public function getId(): ObjectId
65
    {
66 1
        return $this->id;
67
    }
68
}
69