Total Complexity | 6 |
Total Lines | 68 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 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 StringDoc |
||
21 | */ |
||
22 | public function setFormat(string $format) : StringDoc |
||
23 | { |
||
24 | $this->format = $format; |
||
25 | |||
26 | return $this; |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * @param int $minLength |
||
31 | * |
||
32 | * @return StringDoc |
||
33 | */ |
||
34 | public function setMinLength(int $minLength) : StringDoc |
||
35 | { |
||
36 | $this->minLength = $minLength; |
||
37 | |||
38 | return $this; |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * @param int $maxLength |
||
43 | * |
||
44 | * @return StringDoc |
||
45 | */ |
||
46 | public function setMaxLength(int $maxLength) : StringDoc |
||
47 | { |
||
48 | $this->maxLength = $maxLength; |
||
49 | |||
50 | return $this; |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * @return string|null |
||
55 | */ |
||
56 | public function getFormat() |
||
57 | { |
||
58 | return $this->format; |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * @return int|null |
||
63 | */ |
||
64 | public function getMinLength() |
||
65 | { |
||
66 | return $this->minLength; |
||
67 | } |
||
68 | |||
69 | /** |
||
70 | * @return int|null |
||
71 | */ |
||
72 | public function getMaxLength() |
||
75 | } |
||
76 | } |
||
77 |