Completed
Push — master ( 5cb32a...c1f2b6 )
by Russell
02:22
created
tests/JSONTextBasicTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
      */
29 29
     public function __construct()
30 30
     {
31
-        foreach($this->fixtures as $name => $path) {
31
+        foreach ($this->fixtures as $name => $path) {
32 32
             $this->fixtures[$name] = MODULE_DIR . '/' . $path;
33 33
         }
34 34
     }
Please login to merge, or discard this patch.
tests/JSONTextQueryTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      */
53 53
     public function __construct()
54 54
     {
55
-        foreach($this->fixtures as $name => $path) {
55
+        foreach ($this->fixtures as $name => $path) {
56 56
             $this->fixtures[$name] = MODULE_DIR . '/' . $path;
57 57
         }
58 58
     }
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
         $field->setReturnType('array');
279 279
         $field->setValue($this->getFixture('object'));
280 280
         $this->assertEquals(
281
-            [['Subaru' => 'Impreza'],['Kawasaki' => 'KR1S250']],
281
+            [['Subaru' => 'Impreza'], ['Kawasaki' => 'KR1S250']],
282 282
             $field->query('#>', '{"japanese":"fast"}')
283 283
         );
284 284
 
Please login to merge, or discard this patch.
tests/JSONTextSetValueTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
      */
29 29
     public function __construct()
30 30
     {
31
-        foreach($this->fixtures as $name => $path) {
31
+        foreach ($this->fixtures as $name => $path) {
32 32
             $this->fixtures[$name] = MODULE_DIR . '/' . $path;
33 33
         }
34 34
     }
Please login to merge, or discard this patch.
code/models/fieldtypes/JSONText.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
             return $this->returnAsType([]);
298 298
         }
299 299
 
300
-        $count = count($data) -1;
300
+        $count = count($data)-1;
301 301
         $key = array_keys($data)[$count];
302 302
         $val = array_values($data)[$count];
303 303
 
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
                     return $result;
404 404
                 }
405 405
             }
406
-        } else if($expressionParamIsValid) {
406
+        } else if ($expressionParamIsValid) {
407 407
             $backendDBApiInst = \Injector::inst()->createWithArgs(
408 408
                 '\JSONText\Backends\\' . $dbBackend, [
409 409
                 $expression,
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
     /**
120 120
      * @param string $title
121
-     * @return HiddenField
121
+     * @return \HiddenField
122 122
      */
123 123
     public function scaffoldSearchField($title = null)
124 124
     {
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
     /**
129 129
      * @param string $title
130
-     * @return HiddenField
130
+     * @return \HiddenField
131 131
      */
132 132
     public function scaffoldFormField($title = null)
133 133
     {
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
      * to be disallowed.
197 197
      * 
198 198
      * @param string $value
199
-     * @param array $allowed    An optional array of allowed "invalid" JSON values
199
+     * @param string[] $allowed    An optional array of allowed "invalid" JSON values
200 200
      * @return boolean
201 201
      */
202 202
     public function isJson($value, array $allowed = [])
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
     }
265 265
 
266 266
     /**
267
-     * @param mixed $value
267
+     * @param string $value
268 268
      * @return array
269 269
      * @throws \JSONText\Exceptions\JSONTextException
270 270
      */
Please login to merge, or discard this patch.
tests/JSONTextIntegrationTest.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -6,8 +6,6 @@
 block discarded – undo
6 6
  * @author Russell Michell <[email protected]>
7 7
  */
8 8
 
9
-use JSONText\Exceptions;
10
-
11 9
 class JSONTextIntegrationTest extends SapphireTest
12 10
 {
13 11
     
Please login to merge, or discard this patch.