Completed
Branch release/1.0.0 (faa89b)
by Yo
01:45
created

StringDoc::getMinLength()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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 StringDoc
21
     */
22 1
    public function setFormat(string $format) : StringDoc
23
    {
24 1
        $this->format = $format;
25
26 1
        return $this;
27
    }
28
29
    /**
30
     * @param int $minLength
31
     *
32
     * @return StringDoc
33
     */
34 1
    public function setMinLength(int $minLength) : StringDoc
35
    {
36 1
        $this->minLength = $minLength;
37
38 1
        return $this;
39
    }
40
41
    /**
42
     * @param int $maxLength
43
     *
44
     * @return StringDoc
45
     */
46 1
    public function setMaxLength(int $maxLength) : StringDoc
47
    {
48 1
        $this->maxLength = $maxLength;
49
50 1
        return $this;
51
    }
52
53
    /**
54
     * @return string|null
55
     */
56 1
    public function getFormat()
57
    {
58 1
        return $this->format;
59
    }
60
61
    /**
62
     * @return int|null
63
     */
64 1
    public function getMinLength()
65
    {
66 1
        return $this->minLength;
67
    }
68
69
    /**
70
     * @return int|null
71
     */
72 1
    public function getMaxLength()
73
    {
74 1
        return $this->maxLength;
75
    }
76
}
77