@@ -18,11 +18,15 @@ |
||
18 | 18 | { |
19 | 19 | $data = new Rules\ProcessCallback(); |
20 | 20 | $this->assertInstanceOf(Rules\ARule::class, $data); |
21 | - if (!$gotResult) $this->expectException(RuleException::class); |
|
21 | + if (!$gotResult) { |
|
22 | + $this->expectException(RuleException::class); |
|
23 | + } |
|
22 | 24 | $data->setAgainstValue($expectedCall); |
23 | 25 | if ($gotResult) { |
24 | 26 | $mock = MockEntry::init('foo', $checkValue); |
25 | - if (!$pass) $this->expectException(RuleException::class); |
|
27 | + if (!$pass) { |
|
28 | + $this->expectException(RuleException::class); |
|
29 | + } |
|
26 | 30 | $data->validate($mock); |
27 | 31 | } |
28 | 32 | } |
@@ -20,7 +20,9 @@ discard block |
||
20 | 20 | $data = new Rules\LengthMin(); |
21 | 21 | $this->assertInstanceOf(Rules\ARule::class, $data); |
22 | 22 | $data->setAgainstValue($length); |
23 | - if (!$passMin) $this->expectException(RuleException::class); |
|
23 | + if (!$passMin) { |
|
24 | + $this->expectException(RuleException::class); |
|
25 | + } |
|
24 | 26 | $data->validate(MockEntry::init('foo', $value)); |
25 | 27 | } |
26 | 28 | |
@@ -38,7 +40,9 @@ discard block |
||
38 | 40 | $data = new Rules\LengthEquals(); |
39 | 41 | $this->assertInstanceOf(Rules\ARule::class, $data); |
40 | 42 | $data->setAgainstValue($length); |
41 | - if (!$passEq) $this->expectException(RuleException::class); |
|
43 | + if (!$passEq) { |
|
44 | + $this->expectException(RuleException::class); |
|
45 | + } |
|
42 | 46 | $data->validate(MockEntry::init('foo', $value)); |
43 | 47 | } |
44 | 48 | |
@@ -56,7 +60,9 @@ discard block |
||
56 | 60 | $data = new Rules\LengthMax(); |
57 | 61 | $this->assertInstanceOf(Rules\ARule::class, $data); |
58 | 62 | $data->setAgainstValue($length); |
59 | - if (!$passMax) $this->expectException(RuleException::class); |
|
63 | + if (!$passMax) { |
|
64 | + $this->expectException(RuleException::class); |
|
65 | + } |
|
60 | 66 | $data->validate(MockEntry::init('foo', $value)); |
61 | 67 | } |
62 | 68 |
@@ -20,7 +20,9 @@ discard block |
||
20 | 20 | $this->assertInstanceOf(Rules\ARule::class, $data); |
21 | 21 | |
22 | 22 | $mock = MockEntry::init('foo', $checkValue); |
23 | - if (!$isEmail) $this->expectException(RuleException::class); |
|
23 | + if (!$isEmail) { |
|
24 | + $this->expectException(RuleException::class); |
|
25 | + } |
|
24 | 26 | $data->validate($mock); |
25 | 27 | } |
26 | 28 | |
@@ -38,7 +40,9 @@ discard block |
||
38 | 40 | $this->assertInstanceOf(Rules\ARule::class, $data); |
39 | 41 | |
40 | 42 | $mock = MockEntry::init('foo', $checkValue); |
41 | - if (!$isDomain) $this->expectException(RuleException::class); |
|
43 | + if (!$isDomain) { |
|
44 | + $this->expectException(RuleException::class); |
|
45 | + } |
|
42 | 46 | $data->validate($mock); |
43 | 47 | } |
44 | 48 |
@@ -18,7 +18,9 @@ discard block |
||
18 | 18 | { |
19 | 19 | $data = new Rules\IsBool(); |
20 | 20 | $this->assertInstanceOf(Rules\ARule::class, $data); |
21 | - if (!$resultBool) $this->expectException(RuleException::class); |
|
21 | + if (!$resultBool) { |
|
22 | + $this->expectException(RuleException::class); |
|
23 | + } |
|
22 | 24 | $data->validate(MockEntry::init('foo', $value)); |
23 | 25 | } |
24 | 26 | |
@@ -34,7 +36,9 @@ discard block |
||
34 | 36 | { |
35 | 37 | $data = new Rules\IsNumeric(); |
36 | 38 | $this->assertInstanceOf(Rules\ARule::class, $data); |
37 | - if (!$resultNum) $this->expectException(RuleException::class); |
|
39 | + if (!$resultNum) { |
|
40 | + $this->expectException(RuleException::class); |
|
41 | + } |
|
38 | 42 | $data->validate(MockEntry::init('foo', $value)); |
39 | 43 | } |
40 | 44 | |
@@ -50,7 +54,9 @@ discard block |
||
50 | 54 | { |
51 | 55 | $data = new Rules\IsString(); |
52 | 56 | $this->assertInstanceOf(Rules\ARule::class, $data); |
53 | - if (!$resultStr) $this->expectException(RuleException::class); |
|
57 | + if (!$resultStr) { |
|
58 | + $this->expectException(RuleException::class); |
|
59 | + } |
|
54 | 60 | $data->validate(MockEntry::init('foo', $value)); |
55 | 61 | } |
56 | 62 |
@@ -20,7 +20,9 @@ discard block |
||
20 | 20 | $data->setAgainstValue($expectedValue); |
21 | 21 | $this->assertInstanceOf(Rules\ARule::class, $data); |
22 | 22 | $mock = MockEntry::init($key, $checkValue); |
23 | - if (!$gotResult) $this->expectException(RuleException::class); |
|
23 | + if (!$gotResult) { |
|
24 | + $this->expectException(RuleException::class); |
|
25 | + } |
|
24 | 26 | $data->validate($mock); |
25 | 27 | } |
26 | 28 | |
@@ -38,7 +40,9 @@ discard block |
||
38 | 40 | $data->setAgainstValue($expectedValue); |
39 | 41 | $this->assertInstanceOf(Rules\ARule::class, $data); |
40 | 42 | $mock = MockEntry::init($key, $checkValue); |
41 | - if (!$gotResult) $this->expectException(RuleException::class); |
|
43 | + if (!$gotResult) { |
|
44 | + $this->expectException(RuleException::class); |
|
45 | + } |
|
42 | 46 | $data->validate($mock); |
43 | 47 | } |
44 | 48 | } |
@@ -69,7 +69,9 @@ discard block |
||
69 | 69 | $this->assertInstanceOf(Rules\ARule::class, $data); |
70 | 70 | |
71 | 71 | $mock = MockEntry::init('foo', 'bar'); |
72 | - if (!$matchAll) $this->expectException(RuleException::class); |
|
72 | + if (!$matchAll) { |
|
73 | + $this->expectException(RuleException::class); |
|
74 | + } |
|
73 | 75 | $data->validate($mock); |
74 | 76 | } |
75 | 77 | |
@@ -86,7 +88,9 @@ discard block |
||
86 | 88 | $data->setAgainstValue($expectedValue); |
87 | 89 | $this->assertInstanceOf(Rules\ARule::class, $data); |
88 | 90 | $mock = MockEntry::init('foo', 'bar'); |
89 | - if (!$matchAny) $this->expectException(RuleException::class); |
|
91 | + if (!$matchAny) { |
|
92 | + $this->expectException(RuleException::class); |
|
93 | + } |
|
90 | 94 | $data->validate($mock); |
91 | 95 | } |
92 | 96 |
@@ -16,7 +16,9 @@ discard block |
||
16 | 16 | { |
17 | 17 | $data = new Rules\InRange(); |
18 | 18 | $this->assertInstanceOf(Rules\ARule::class, $data); |
19 | - if ($gotException) $this->expectException(RuleException::class); |
|
19 | + if ($gotException) { |
|
20 | + $this->expectException(RuleException::class); |
|
21 | + } |
|
20 | 22 | $data->setAgainstValue($expectedValue); |
21 | 23 | } |
22 | 24 | |
@@ -47,7 +49,9 @@ discard block |
||
47 | 49 | $data->setAgainstValue([$lowerLimit, $upperLimit]); |
48 | 50 | $this->assertInstanceOf(Rules\ARule::class, $data); |
49 | 51 | $mock = MockEntry::init('foo', $checkValue); |
50 | - if (!$range) $this->expectException(RuleException::class); |
|
52 | + if (!$range) { |
|
53 | + $this->expectException(RuleException::class); |
|
54 | + } |
|
51 | 55 | $data->validate($mock); |
52 | 56 | } |
53 | 57 | |
@@ -66,7 +70,9 @@ discard block |
||
66 | 70 | $data->setAgainstValue([$lowerLimit, $upperLimit]); |
67 | 71 | $this->assertInstanceOf(Rules\ARule::class, $data); |
68 | 72 | $mock = MockEntry::init('foo', $checkValue); |
69 | - if (!$rangeEq) $this->expectException(RuleException::class); |
|
73 | + if (!$rangeEq) { |
|
74 | + $this->expectException(RuleException::class); |
|
75 | + } |
|
70 | 76 | $data->validate($mock); |
71 | 77 | } |
72 | 78 | |
@@ -85,7 +91,9 @@ discard block |
||
85 | 91 | $data->setAgainstValue([$lowerLimit, $upperLimit]); |
86 | 92 | $this->assertInstanceOf(Rules\ARule::class, $data); |
87 | 93 | $mock = MockEntry::init('foo', $checkValue); |
88 | - if ($range) $this->expectException(RuleException::class); |
|
94 | + if ($range) { |
|
95 | + $this->expectException(RuleException::class); |
|
96 | + } |
|
89 | 97 | $data->validate($mock); |
90 | 98 | } |
91 | 99 | |
@@ -104,7 +112,9 @@ discard block |
||
104 | 112 | $data->setAgainstValue([$lowerLimit, $upperLimit]); |
105 | 113 | $this->assertInstanceOf(Rules\ARule::class, $data); |
106 | 114 | $mock = MockEntry::init('foo', $checkValue); |
107 | - if ($rangeEq) $this->expectException(RuleException::class); |
|
115 | + if ($rangeEq) { |
|
116 | + $this->expectException(RuleException::class); |
|
117 | + } |
|
108 | 118 | $data->validate($mock); |
109 | 119 | } |
110 | 120 |
@@ -38,7 +38,9 @@ discard block |
||
38 | 38 | $data = new File\ImageSizeEquals(); |
39 | 39 | $this->assertInstanceOf(File\AFileRule::class, $data); |
40 | 40 | $data->setAgainstValue([$maxSizeX, $maxSizeY]); |
41 | - if (!$matchEquals) $this->expectException(RuleException::class); |
|
41 | + if (!$matchEquals) { |
|
42 | + $this->expectException(RuleException::class); |
|
43 | + } |
|
42 | 44 | $data->validate($this->getMockImage()); |
43 | 45 | } |
44 | 46 | |
@@ -63,7 +65,9 @@ discard block |
||
63 | 65 | $data = new File\ImageSizeList(); |
64 | 66 | $this->assertInstanceOf(File\AFileRule::class, $data); |
65 | 67 | $data->setAgainstValue([[$maxSizeX, $maxSizeY]]); |
66 | - if (!$matchEquals) $this->expectException(RuleException::class); |
|
68 | + if (!$matchEquals) { |
|
69 | + $this->expectException(RuleException::class); |
|
70 | + } |
|
67 | 71 | $data->validate($this->getMockImage()); |
68 | 72 | } |
69 | 73 | |
@@ -95,7 +99,9 @@ discard block |
||
95 | 99 | $data = new File\ImageSizeMin(); |
96 | 100 | $this->assertInstanceOf(File\AFileRule::class, $data); |
97 | 101 | $data->setAgainstValue([$maxSizeX, $maxSizeY]); |
98 | - if (!$matchMin) $this->expectException(RuleException::class); |
|
102 | + if (!$matchMin) { |
|
103 | + $this->expectException(RuleException::class); |
|
104 | + } |
|
99 | 105 | $data->validate($this->getMockImage()); |
100 | 106 | } |
101 | 107 | |
@@ -121,7 +127,9 @@ discard block |
||
121 | 127 | $data = new File\ImageSizeMax(); |
122 | 128 | $this->assertInstanceOf(File\AFileRule::class, $data); |
123 | 129 | $data->setAgainstValue([$maxSizeX, $maxSizeY]); |
124 | - if (!$matchMax) $this->expectException(RuleException::class); |
|
130 | + if (!$matchMax) { |
|
131 | + $this->expectException(RuleException::class); |
|
132 | + } |
|
125 | 133 | $data->validate($this->getMockImage()); |
126 | 134 | } |
127 | 135 |
@@ -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 |