Passed
Push — master ( ada358...0ded9f )
by Petr
06:58 queued 04:25
created
php-tests/BasicTests/BasicFactoryTest.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,9 +25,13 @@
 block discarded – undo
25 25
     public function testFactoryAvailability(string $rule, bool $gotResult)
26 26
     {
27 27
         $factory = new Rules\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('\kalanis\kw_rules\Rules\ARule', $data);
32
+        if ($data) {
33
+            $this->assertInstanceOf('\kalanis\kw_rules\Rules\ARule', $data);
34
+        }
31 35
     }
32 36
 
33 37
     public function inputsProvider()
Please login to merge, or discard this patch.
php-tests/BasicTests/ImageRulesTest.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -136,12 +136,12 @@
 block discarded – undo
136 136
     public function sizeMatchProvider()
137 137
     {
138 138
         return [
139
-            ['6', '5', true,  true,  true ],
139
+            ['6', '5', true, true, true],
140 140
             ['5', '6', false, false, false],
141
-            ['5', '5', false, true,  false],
142
-            ['6', '6', false, false, true ],
143
-            ['4', '0', false, true,  false],
144
-            ['0', '7', false, false, true ],
141
+            ['5', '5', false, true, false],
142
+            ['6', '6', false, false, true],
143
+            ['4', '0', false, true, false],
144
+            ['0', '7', false, false, true],
145 145
         ];
146 146
     }
147 147
 }
Please login to merge, or discard this patch.
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,7 +38,9 @@  discard block
 block discarded – undo
38 38
         $data = new File\ImageSizeEquals();
39 39
         $this->assertInstanceOf('\kalanis\kw_rules\Rules\File\AFileRule', $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
 block discarded – undo
63 65
         $data = new File\ImageSizeList();
64 66
         $this->assertInstanceOf('\kalanis\kw_rules\Rules\File\AFileRule', $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
 block discarded – undo
95 99
         $data = new File\ImageSizeMin();
96 100
         $this->assertInstanceOf('\kalanis\kw_rules\Rules\File\AFileRule', $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
 block discarded – undo
121 127
         $data = new File\ImageSizeMax();
122 128
         $this->assertInstanceOf('\kalanis\kw_rules\Rules\File\AFileRule', $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
 
Please login to merge, or discard this patch.
php-tests/CommonTestClass.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,20 +20,20 @@
 block discarded – undo
20 20
     {
21 21
         return MockFile::init('foo', 'test1.gif', 'text/plain',
22 22
             realpath(implode(DIRECTORY_SEPARATOR, [__DIR__, 'data', 'tester.gif'])),
23
-            55, UPLOAD_ERR_OK );
23
+            55, UPLOAD_ERR_OK);
24 24
     }
25 25
 
26 26
     protected function getMockFile()
27 27
     {
28 28
         return MockFile::init('foo', 'text1.txt', 'text/plain',
29 29
             realpath(implode(DIRECTORY_SEPARATOR, [__DIR__, 'data', 'testing.1.txt'])),
30
-            13, UPLOAD_ERR_OK );
30
+            13, UPLOAD_ERR_OK);
31 31
     }
32 32
 
33 33
     protected function getMockNoFile()
34 34
     {
35 35
         return MockFile::init('foo', 'text0.txt', 'text/plain',
36
-            '', 26, UPLOAD_ERR_NO_FILE );
36
+            '', 26, UPLOAD_ERR_NO_FILE);
37 37
     }
38 38
 }
39 39
 
Please login to merge, or discard this patch.
php-src/Rules/UrlExists.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
     public function validate(IValidate $entry): void
19 19
     {
20 20
         $headers = @get_headers(strval($entry->getValue()));
21
-        if (!empty($headers) && (false !== mb_strpos($headers[0], '200') )) {
21
+        if (!empty($headers) && (false !== mb_strpos($headers[0], '200'))) {
22 22
             return;
23 23
         }
24 24
         throw new RuleException(sprintf($this->errorText, $entry->getKey()));
Please login to merge, or discard this patch.
php-src/Rules/TCheckRules.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
         if (!is_object($singleRule)) {
39 39
             throw new RuleException('Input is not an object.');
40 40
         }
41
-        if (! ( ($singleRule instanceof ARule) || ($singleRule instanceof File\AFileRule) ) ) {
41
+        if (!(($singleRule instanceof ARule) || ($singleRule instanceof File\AFileRule))) {
42 42
             throw new RuleException(sprintf('Input %s is not instance of ARule or AFileRule.', get_class($singleRule)));
43 43
         }
44 44
         return $singleRule;
Please login to merge, or discard this patch.
php-src/Rules/Safe/HashedPassEquals.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 {
19 19
     public function validate(IValidate $entry): void
20 20
     {
21
-        if (!password_verify( strval($entry->getValue()), strval($this->againstValue) )) {
21
+        if (!password_verify(strval($entry->getValue()), strval($this->againstValue))) {
22 22
             throw new RuleException($this->errorText);
23 23
         }
24 24
     }
Please login to merge, or discard this patch.
php-src/Rules/Safe/HashedFuncEquals.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 {
18 18
     public function validate(IValidate $entry): void
19 19
     {
20
-        if (!hash_equals( strval($this->againstValue), strval($entry->getValue()) )) {
20
+        if (!hash_equals(strval($this->againstValue), strval($entry->getValue()))) {
21 21
             throw new RuleException($this->errorText);
22 22
         }
23 23
     }
Please login to merge, or discard this patch.
php-src/Rules/Factory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,8 +52,8 @@
 block discarded – undo
52 52
 //        IRules::IS_POST_CODE           => '\kalanis\kw_rules\Rules\External\IsPostCode',  // too many formats for simple check, use regex
53 53
 //        IRules::IS_TELEPHONE           => '\kalanis\kw_rules\Rules\External\IsPhone',  // too many formats for simple check, use regex
54 54
 //        IRules::IS_EU_VAT              => '\kalanis\kw_rules\Rules\External\IsEuVat',  // too many formats, needs some library for checking
55
-        IRules::IS_DATE                => '\kalanis\kw_rules\Rules\External\IsDate',  // too many formats, needs some library for checking
56
-        IRules::IS_DATE_REGEX          => '\kalanis\kw_rules\Rules\External\IsDateRegex',  // too many formats, needs some library for checking
55
+        IRules::IS_DATE                => '\kalanis\kw_rules\Rules\External\IsDate', // too many formats, needs some library for checking
56
+        IRules::IS_DATE_REGEX          => '\kalanis\kw_rules\Rules\External\IsDateRegex', // too many formats, needs some library for checking
57 57
         IRules::SAFE_EQUALS_BASIC      => '\kalanis\kw_rules\Rules\Safe\HashedBasicEquals',
58 58
         IRules::SAFE_EQUALS_FUNC       => '\kalanis\kw_rules\Rules\Safe\HashedFuncEquals',
59 59
         IRules::SAFE_EQUALS_PASS       => '\kalanis\kw_rules\Rules\Safe\HashedPassEquals',
Please login to merge, or discard this patch.
php-src/Rules/TCheckEntry.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
         if (!is_object($againstValue)) {
27 27
             throw new RuleException('Input is not an object.');
28 28
         }
29
-        if (! ($againstValue instanceof IValidate) ) {
29
+        if (!($againstValue instanceof IValidate)) {
30 30
             throw new RuleException(sprintf('Input %s is not instance of IValidate.', get_class($againstValue)));
31 31
         }
32 32
         return $againstValue;
Please login to merge, or discard this patch.