Passed
Pull Request — 12.4.x (#176)
by Tom
01:33
created
src/Type/Date.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     public function parseLiteral(ASTNode $valueNode, array|null $variables = null): DateTime|null
27 27
     {
28 28
         // @codeCoverageIgnoreStart
29
-        if (! $valueNode instanceof StringValueNode) {
29
+        if (!$valueNode instanceof StringValueNode) {
30 30
             throw new Error('Query error: Can only parse strings got: ' . $valueNode->kind, $valueNode);
31 31
         }
32 32
 
@@ -38,11 +38,11 @@  discard block
 block discarded – undo
38 38
     #[Override]
39 39
     public function parseValue(mixed $value): DateTime
40 40
     {
41
-        if (! is_string($value)) {
41
+        if (!is_string($value)) {
42 42
             throw new Error('Date is not a string: ' . $value);
43 43
         }
44 44
 
45
-        if (! preg_match('/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/', $value)) {
45
+        if (!preg_match('/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/', $value)) {
46 46
             throw new Error('Date format does not match Y-m-d e.g. 2004-02-12.');
47 47
         }
48 48
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             throw new Error('Expected DateTime object.  Got string.');
57 57
         }
58 58
 
59
-        if (! $value instanceof DateTime) {
59
+        if (!$value instanceof DateTime) {
60 60
             throw new Error('Expected DateTime object.  Got ' . $value::class);
61 61
         }
62 62
 
Please login to merge, or discard this patch.
src/Type/TimeImmutable.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     public function parseLiteral(ASTNode $valueNode, array|null $variables = null): string
28 28
     {
29 29
         // @codeCoverageIgnoreStart
30
-        if (! $valueNode instanceof StringValueNode) {
30
+        if (!$valueNode instanceof StringValueNode) {
31 31
             throw new Error('Query error: Can only parse strings got: ' . $valueNode->kind, $valueNode);
32 32
         }
33 33
 
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
     #[Override]
40 40
     public function parseValue(mixed $value): PHPDateTime|false
41 41
     {
42
-        if (! is_string($value)) {
42
+        if (!is_string($value)) {
43 43
             throw new Error('Time is not a string: ' . $value);
44 44
         }
45 45
 
46
-        if (! preg_match('/^([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])(\.\d{1,6})?$/', $value)) {
46
+        if (!preg_match('/^([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])(\.\d{1,6})?$/', $value)) {
47 47
             throw new Error('Time ' . $value . ' format does not match H:i:s.u e.g. 13:34:40.867530');
48 48
         }
49 49
 
Please login to merge, or discard this patch.
src/Type/DateTime.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     public function parseLiteral(ASTNode $valueNode, array|null $variables = null): PHPDateTime
27 27
     {
28 28
         // @codeCoverageIgnoreStart
29
-        if (! $valueNode instanceof StringValueNode) {
29
+        if (!$valueNode instanceof StringValueNode) {
30 30
             throw new Error('Query error: Can only parse strings got: ' . $valueNode->kind, $valueNode);
31 31
         }
32 32
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     #[Override]
39 39
     public function parseValue(mixed $value): PHPDateTime
40 40
     {
41
-        if (! is_string($value)) {
41
+        if (!is_string($value)) {
42 42
             throw new Error('datetime is not a string: ' . $value);
43 43
         }
44 44
 
Please login to merge, or discard this patch.
src/Type/Time.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     public function parseLiteral(ASTNode $valueNode, array|null $variables = null): string|null
28 28
     {
29 29
         // @codeCoverageIgnoreStart
30
-        if (! $valueNode instanceof StringValueNode) {
30
+        if (!$valueNode instanceof StringValueNode) {
31 31
             throw new Error('Query error: Can only parse strings got: ' . $valueNode->kind, $valueNode);
32 32
         }
33 33
 
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
     #[Override]
43 43
     public function parseValue(mixed $value): PHPDateTime
44 44
     {
45
-        if (! is_string($value)) {
45
+        if (!is_string($value)) {
46 46
             throw new Error('Time is not a string: ' . $value);
47 47
         }
48 48
 
49
-        if (! preg_match('/^([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])(\.\d{1,6})?$/', $value)) {
49
+        if (!preg_match('/^([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])(\.\d{1,6})?$/', $value)) {
50 50
             throw new Error('Time ' . $value . ' format does not match H:i:s.u e.g. 13:34:40.867530');
51 51
         }
52 52
 
Please login to merge, or discard this patch.
src/Type/Blob.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     public function parseLiteral(ASTNode $valueNode, array|null $variables = null): string
28 28
     {
29 29
         // @codeCoverageIgnoreStart
30
-        if (! $valueNode instanceof StringValueNode) {
30
+        if (!$valueNode instanceof StringValueNode) {
31 31
             throw new Error('Query error: Can only parse strings got: ' . $valueNode->kind, $valueNode);
32 32
         }
33 33
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     #[Override]
40 40
     public function parseValue(mixed $value): mixed
41 41
     {
42
-        if (! is_string($value)) {
42
+        if (!is_string($value)) {
43 43
             throw new Error('Blob field as base64 is not a string: ' . $value);
44 44
         }
45 45
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     #[Override]
56 56
     public function serialize(mixed $value): mixed
57 57
     {
58
-        if (! $value) {
58
+        if (!$value) {
59 59
             return $value;
60 60
         }
61 61
 
Please login to merge, or discard this patch.
src/Type/DateTimeImmutable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     public function parseLiteral(ASTNode $valueNode, array|null $variables = null): PHPDateTimeImmutable
27 27
     {
28 28
         // @codeCoverageIgnoreStart
29
-        if (! $valueNode instanceof StringValueNode) {
29
+        if (!$valueNode instanceof StringValueNode) {
30 30
             throw new Error('Query error: Can only parse strings got: ' . $valueNode->kind, $valueNode);
31 31
         }
32 32
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     #[Override]
39 39
     public function parseValue(mixed $value): PHPDateTimeImmutable
40 40
     {
41
-        if (! is_string($value)) {
41
+        if (!is_string($value)) {
42 42
             throw new Error('datetime_immutable is not a string: ' . $value);
43 43
         }
44 44
 
Please login to merge, or discard this patch.
src/Type/Json.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     public function parseLiteral(ASTNode $valueNode, array|null $variables = null): string
27 27
     {
28 28
         // @codeCoverageIgnoreStart
29
-        if (! $valueNode instanceof StringValueNode) {
29
+        if (!$valueNode instanceof StringValueNode) {
30 30
             throw new Error('Query error: Can only parse strings got: ' . $valueNode->kind, $valueNode);
31 31
         }
32 32
 
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
     #[Override]
43 43
     public function parseValue(mixed $value): array|null
44 44
     {
45
-        if (! is_string($value)) {
45
+        if (!is_string($value)) {
46 46
             throw new Error('JSON is not a string: ' . $value);
47 47
         }
48 48
 
49 49
         $data = json_decode($value, true);
50 50
 
51
-        if (! $data) {
51
+        if (!$data) {
52 52
             throw new Error('Could not parse JSON data');
53 53
         }
54 54
 
Please login to merge, or discard this patch.
src/Filter/QueryBuilder.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 
147 147
     protected function sort(string $field, string $direction, DoctrineQueryBuilder $queryBuilder): void
148 148
     {
149
-        if (! isset($this->sortFields[$field])) {
149
+        if (!isset($this->sortFields[$field])) {
150 150
             $this->sortFields[$field] = [];
151 151
         }
152 152
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
     protected function sortPriority(string $field, int $priority, DoctrineQueryBuilder $queryBuilder): void
159 159
     {
160
-        if (! isset($this->sortFields[$field])) {
160
+        if (!isset($this->sortFields[$field])) {
161 161
             $this->sortFields[$field] = [];
162 162
         }
163 163
 
@@ -169,12 +169,12 @@  discard block
 block discarded – undo
169 169
     protected function applySort(DoctrineQueryBuilder $queryBuilder): void
170 170
     {
171 171
         // If no sort fields were added, do nothing
172
-        if (! $this->sortFields) {
172
+        if (!$this->sortFields) {
173 173
             return;
174 174
         }
175 175
 
176 176
         // Sort fields by priority if set, otherwise by field name
177
-        uasort($this->sortFields, static function ($a, $b) {
177
+        uasort($this->sortFields, static function($a, $b) {
178 178
             if (isset($a['priority']) && isset($b['priority'])) {
179 179
                 return $a['priority'] <=> $b['priority'];
180 180
             }
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 
187 187
         foreach ($this->sortFields as $field => $sort) {
188 188
             // If the direction is not set, default to 'ASC'
189
-            if (! isset($sort['direction'])) {
189
+            if (!isset($sort['direction'])) {
190 190
                 throw new Error(
191 191
                     "Sort direction for field '"
192 192
                     . $field
Please login to merge, or discard this patch.