1 | <?php |
||
11 | final class StringEnsurance implements EnsuranceInterface |
||
12 | { |
||
13 | use EnsuranceTrait; |
||
14 | |||
15 | /** |
||
16 | * StringEnsurance constructor. |
||
17 | * |
||
18 | * @param EnsuranceInterface $ensurance |
||
19 | */ |
||
20 | public function __construct(EnsuranceInterface $ensurance) |
||
24 | |||
25 | 12 | /** |
|
26 | 12 | * @param string $str |
|
27 | * |
||
28 | * @return StringEnsurance |
||
29 | */ |
||
30 | public function isEqualTo(string $str): self |
||
36 | |||
37 | 1 | /** |
|
38 | * @param string $str |
||
39 | * |
||
40 | * @return StringEnsurance |
||
41 | */ |
||
42 | public function isNotEqualTo(string $str): self |
||
48 | |||
49 | 1 | /** |
|
50 | * @param string $pattern |
||
51 | * |
||
52 | * @return StringEnsurance |
||
53 | */ |
||
54 | public function matches(string $pattern): self |
||
60 | |||
61 | 1 | /** |
|
62 | * @param int $length |
||
63 | * |
||
64 | * @return StringEnsurance |
||
65 | */ |
||
66 | public function hasLengthOf(int $length): self |
||
73 | |||
74 | 1 | /** |
|
75 | * @param int $length |
||
76 | * |
||
77 | * @return StringEnsurance |
||
78 | */ |
||
79 | public function isShorterThan(int $length): self |
||
86 | |||
87 | 1 | /** |
|
88 | * @param int $length |
||
89 | * |
||
90 | * @return StringEnsurance |
||
91 | */ |
||
92 | public function isShorterOrEqualTo(int $length): self |
||
99 | |||
100 | 1 | /** |
|
101 | * @param int $length |
||
102 | * |
||
103 | * @return StringEnsurance |
||
104 | */ |
||
105 | public function isLongerThan(int $length): self |
||
112 | |||
113 | 1 | /** |
|
114 | * @param int $length |
||
115 | * |
||
116 | * @return StringEnsurance |
||
117 | */ |
||
118 | public function isLongerOrEqualTo(int $length): self |
||
125 | |||
126 | 1 | /** |
|
127 | * @param string $str |
||
128 | * |
||
129 | * @return StringEnsurance |
||
130 | */ |
||
131 | public function beginsWith(string $str): self |
||
137 | 1 | ||
138 | /** |
||
139 | 1 | * @param string $str |
|
140 | * |
||
141 | * @return StringEnsurance |
||
142 | */ |
||
143 | public function endsWith(string $str): self |
||
150 | 1 | ||
151 | /** |
||
152 | 1 | * @return StringEnsurance |
|
153 | */ |
||
154 | public function isCallable(): self |
||
160 | 1 | ||
161 | 1 | /** |
|
162 | * @return ReflectionEnsurance |
||
163 | * @throws \ReflectionException |
||
164 | */ |
||
165 | public function isClass(): ReflectionEnsurance |
||
171 | |||
172 | /** |
||
173 | * @return StringEnsurance |
||
174 | */ |
||
175 | public function isJson(): self |
||
183 | |||
184 | /** |
||
185 | * @return StringEnsurance |
||
186 | */ |
||
187 | public function isXml(): self |
||
200 | } |
||
201 |