Total Complexity | 6 |
Total Lines | 68 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
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 |
|
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 |
|
75 | } |
||
76 | } |
||
77 |