StringDoc::setFormat()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
namespace Yoanm\JsonRpcServerDoc\Domain\Model\Type;
3
4
/**
5
 * Class StringDoc
6
 */
7
class StringDoc extends ScalarDoc
8
{
9
    /*** Validation ***/
10
    /** @var string|null */
11
    private $format = null;
12
    /** @var int|null */
13
    private $minLength = null;
14
    /** @var int|null */
15
    private $maxLength = null;
16
17
    /**
18
     * @param string $format
19
     *
20
     * @return self
21
     */
22 2
    public function setFormat(string $format) : self
23
    {
24 2
        $this->format = $format;
25
26 2
        return $this;
27
    }
28
29
    /**
30
     * @param int $minLength
31
     *
32
     * @return self
33
     */
34 2
    public function setMinLength(int $minLength) : self
35
    {
36 2
        $this->minLength = $minLength;
37
38 2
        return $this;
39
    }
40
41
    /**
42
     * @param int $maxLength
43
     *
44
     * @return self
45
     */
46 2
    public function setMaxLength(int $maxLength) : self
47
    {
48 2
        $this->maxLength = $maxLength;
49
50 2
        return $this;
51
    }
52
53
    /**
54
     * @return string|null
55
     */
56 6
    public function getFormat() : ?string
57
    {
58 6
        return $this->format;
59
    }
60
61
    /**
62
     * @return int|null
63
     */
64 6
    public function getMinLength() : ?int
65
    {
66 6
        return $this->minLength;
67
    }
68
69
    /**
70
     * @return int|null
71
     */
72 6
    public function getMaxLength() : ?int
73
    {
74 6
        return $this->maxLength;
75
    }
76
}
77