ChunkedTests::getChunks()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace PHPChunkit;
6
7
/**
8
 * @testClass PHPChunkit\Test\ChunkedTestsTest
9
 */
10
class ChunkedTests
11
{
12
    /**
13
     * @var int
14
     */
15
    private $chunk;
16
17
    /**
18
     * @var int
19
     */
20
    private $numChunks = 1;
21
22
    /**
23
     * @var int
24
     */
25
    private $testsPerChunk = 0;
26
27
    /**
28
     * @var array
29
     */
30
    private $chunks = [];
31
32
    /**
33
     * @var int
34
     */
35
    private $totalTests = 0;
36
37 3
    public function getChunk()
38
    {
39 3
        return $this->chunk;
40
    }
41
42 2
    public function setChunk(int $chunk) : self
43
    {
44 2
        $this->chunk = $chunk;
45
46 2
        return $this;
47
    }
48
49 3
    public function getNumChunks() : int
50
    {
51 3
        return $this->numChunks;
52
    }
53
54 3
    public function setNumChunks(int $numChunks) : self
55
    {
56 3
        $this->numChunks = $numChunks;
57
58 3
        return $this;
59
    }
60
61 2
    public function getTestsPerChunk() : int
62
    {
63 2
        return $this->testsPerChunk;
64
    }
65
66 2
    public function setTestsPerChunk(int $testsPerChunk) : self
67
    {
68 2
        $this->testsPerChunk = $testsPerChunk;
69
70 2
        return $this;
71
    }
72
73 3
    public function getChunks() : array
74
    {
75 3
        return $this->chunks;
76
    }
77
78 2
    public function setChunks(array $chunks) : self
79
    {
80 2
        $this->chunks = $chunks;
81
82 2
        return $this;
83
    }
84
85 2
    public function getTotalTests() : int
86
    {
87 2
        return $this->totalTests;
88
    }
89
90 3
    public function setTotalTests(int $totalTests) : self
91
    {
92 3
        $this->totalTests = $totalTests;
93
94 3
        return $this;
95
    }
96
97 1
    public function hasTests() : bool
98
    {
99 1
        return $this->totalTests ? true : false;
100
    }
101
}
102