@@ -28,9 +28,13 @@ |
||
28 | 28 | public function testFactoryAvailability(string $rule, bool $gotResult): void |
29 | 29 | { |
30 | 30 | $factory = new Rules\Factory(); |
31 | - if (!$gotResult) $this->expectException(RuleException::class); |
|
31 | + if (!$gotResult) { |
|
32 | + $this->expectException(RuleException::class); |
|
33 | + } |
|
32 | 34 | $data = $factory->getRule($rule); |
33 | - if ($data) $this->assertInstanceOf(Rules\ARule::class, $data); |
|
35 | + if ($data) { |
|
36 | + $this->assertInstanceOf(Rules\ARule::class, $data); |
|
37 | + } |
|
34 | 38 | } |
35 | 39 | |
36 | 40 | public function inputsProvider(): array |
@@ -22,7 +22,9 @@ discard block |
||
22 | 22 | $this->assertInstanceOf(Rules\ARule::class, $data); |
23 | 23 | |
24 | 24 | $mock = MockEntry::init($key, $checkValue); |
25 | - if (!$gotResult) $this->expectException(RuleException::class); |
|
25 | + if (!$gotResult) { |
|
26 | + $this->expectException(RuleException::class); |
|
27 | + } |
|
26 | 28 | $data->validate($mock); |
27 | 29 | } |
28 | 30 | |
@@ -40,7 +42,9 @@ discard block |
||
40 | 42 | $data->setAgainstValue($expectedValue); |
41 | 43 | $this->assertInstanceOf(Rules\ARule::class, $data); |
42 | 44 | $mock = MockEntry::init($key, $checkValue); |
43 | - if ($gotResult) $this->expectException(RuleException::class); |
|
45 | + if ($gotResult) { |
|
46 | + $this->expectException(RuleException::class); |
|
47 | + } |
|
44 | 48 | $data->validate($mock); |
45 | 49 | } |
46 | 50 | |
@@ -56,11 +60,15 @@ discard block |
||
56 | 60 | { |
57 | 61 | $data = new Rules\IsInArray(); |
58 | 62 | $this->assertInstanceOf(Rules\ARule::class, $data); |
59 | - if ($gotError) $this->expectException(RuleException::class); |
|
63 | + if ($gotError) { |
|
64 | + $this->expectException(RuleException::class); |
|
65 | + } |
|
60 | 66 | $data->setAgainstValue($expectedValues); |
61 | 67 | if (!$gotError) { |
62 | 68 | $mock = MockEntry::init('foo', $checkValue); |
63 | - if (!$gotResult) $this->expectException(RuleException::class); |
|
69 | + if (!$gotResult) { |
|
70 | + $this->expectException(RuleException::class); |
|
71 | + } |
|
64 | 72 | $data->validate($mock); |
65 | 73 | } |
66 | 74 | } |
@@ -77,11 +85,15 @@ discard block |
||
77 | 85 | { |
78 | 86 | $data = new Rules\IsNotInArray(); |
79 | 87 | $this->assertInstanceOf(Rules\ARule::class, $data); |
80 | - if ($gotError) $this->expectException(RuleException::class); |
|
88 | + if ($gotError) { |
|
89 | + $this->expectException(RuleException::class); |
|
90 | + } |
|
81 | 91 | $data->setAgainstValue($expectedValues); |
82 | 92 | if (!$gotError) { |
83 | 93 | $mock = MockEntry::init('foo', $checkValue); |
84 | - if ($gotResult) $this->expectException(RuleException::class); |
|
94 | + if ($gotResult) { |
|
95 | + $this->expectException(RuleException::class); |
|
96 | + } |
|
85 | 97 | $data->validate($mock); |
86 | 98 | } |
87 | 99 | } |
@@ -112,7 +124,9 @@ discard block |
||
112 | 124 | $data->setAgainstValue($expectedValue); |
113 | 125 | $this->assertInstanceOf(Rules\ARule::class, $data); |
114 | 126 | $mock = MockEntry::init('foo', $checkValue); |
115 | - if (!$gotResult) $this->expectException(RuleException::class); |
|
127 | + if (!$gotResult) { |
|
128 | + $this->expectException(RuleException::class); |
|
129 | + } |
|
116 | 130 | $data->validate($mock); |
117 | 131 | } |
118 | 132 | |
@@ -129,7 +143,9 @@ discard block |
||
129 | 143 | $data->setAgainstValue($expectedValue); |
130 | 144 | $this->assertInstanceOf(Rules\ARule::class, $data); |
131 | 145 | $mock = MockEntry::init('foo', $checkValue); |
132 | - if (!$gotResult) $this->expectException(RuleException::class); |
|
146 | + if (!$gotResult) { |
|
147 | + $this->expectException(RuleException::class); |
|
148 | + } |
|
133 | 149 | $data->validate($mock); |
134 | 150 | } |
135 | 151 | |
@@ -146,7 +162,9 @@ discard block |
||
146 | 162 | $data->setAgainstValue($expectedValue); |
147 | 163 | $this->assertInstanceOf(Rules\ARule::class, $data); |
148 | 164 | $mock = MockEntry::init('foo', $checkValue); |
149 | - if ($gotResult) $this->expectException(RuleException::class); |
|
165 | + if ($gotResult) { |
|
166 | + $this->expectException(RuleException::class); |
|
167 | + } |
|
150 | 168 | $data->validate($mock); |
151 | 169 | } |
152 | 170 | |
@@ -163,7 +181,9 @@ discard block |
||
163 | 181 | $data->setAgainstValue($expectedValue); |
164 | 182 | $this->assertInstanceOf(Rules\ARule::class, $data); |
165 | 183 | $mock = MockEntry::init('foo', $checkValue); |
166 | - if ($gotResult) $this->expectException(RuleException::class); |
|
184 | + if ($gotResult) { |
|
185 | + $this->expectException(RuleException::class); |
|
186 | + } |
|
167 | 187 | $data->validate($mock); |
168 | 188 | } |
169 | 189 | |
@@ -211,7 +231,9 @@ discard block |
||
211 | 231 | $data = new Rules\IsEmpty(); |
212 | 232 | $this->assertInstanceOf(Rules\ARule::class, $data); |
213 | 233 | $mock = MockEntry::init('foo', $checkValue); |
214 | - if ($gotResult) $this->expectException(RuleException::class); |
|
234 | + if ($gotResult) { |
|
235 | + $this->expectException(RuleException::class); |
|
236 | + } |
|
215 | 237 | $data->validate($mock); |
216 | 238 | } |
217 | 239 | |
@@ -226,7 +248,9 @@ discard block |
||
226 | 248 | $data = new Rules\IsFilled(); |
227 | 249 | $this->assertInstanceOf(Rules\ARule::class, $data); |
228 | 250 | $mock = MockEntry::init('foo', $checkValue); |
229 | - if (!$gotResult) $this->expectException(RuleException::class); |
|
251 | + if (!$gotResult) { |
|
252 | + $this->expectException(RuleException::class); |
|
253 | + } |
|
230 | 254 | $data->validate($mock); |
231 | 255 | } |
232 | 256 | |
@@ -252,7 +276,9 @@ discard block |
||
252 | 276 | $data = new Rules\IsJsonString(); |
253 | 277 | $this->assertInstanceOf(Rules\ARule::class, $data); |
254 | 278 | $mock = MockEntry::init('foo', $checkValue); |
255 | - if (!$gotResult) $this->expectException(RuleException::class); |
|
279 | + if (!$gotResult) { |
|
280 | + $this->expectException(RuleException::class); |
|
281 | + } |
|
256 | 282 | $data->validate($mock); |
257 | 283 | } |
258 | 284 |
@@ -25,9 +25,13 @@ |
||
25 | 25 | public function testFileFactoryAvailability(string $rule, bool $gotResult): void |
26 | 26 | { |
27 | 27 | $factory = new Rules\File\Factory(); |
28 | - if (!$gotResult) $this->expectException(RuleException::class); |
|
28 | + if (!$gotResult) { |
|
29 | + $this->expectException(RuleException::class); |
|
30 | + } |
|
29 | 31 | $data = $factory->getRule($rule); |
30 | - if ($data) $this->assertInstanceOf(Rules\File\AFileRule::class, $data); |
|
32 | + if ($data) { |
|
33 | + $this->assertInstanceOf(Rules\File\AFileRule::class, $data); |
|
34 | + } |
|
31 | 35 | } |
32 | 36 | |
33 | 37 | public function inputFilesProvider(): array |