Completed
Push — master ( 7b46e5...af643a )
by Russell
02:45
created
code/models/fieldtypes/JSONText.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
      * Tell all class methods to return data as JSON , an array or an array of SilverStripe DBField subtypes.
127 127
      * 
128 128
      * @param string $type
129
-     * @return \JSONText
129
+     * @return JSONText
130 130
      * @throws \JSONText\Exceptions\JSONTextException
131 131
      */
132 132
     public function setReturnType($type)
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
      * Convert an array to JSON via json_encode().
202 202
      * 
203 203
      * @param array $value
204
-     * @return mixed null|string
204
+     * @return string null|string
205 205
      */
206 206
     public function toJson(array $value)
207 207
     {
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
     }
243 243
 
244 244
     /**
245
-     * @param mixed $value
245
+     * @param string $value
246 246
      * @return array
247 247
      * @throws \JSONText\Exceptions\JSONTextException
248 248
      */
Please login to merge, or discard this patch.
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.
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/JSONTextTest.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,6 @@
 block discarded – undo
7 7
  */
8 8
 
9 9
 use JSONText\Fields;
10
-use JSONText\Exceptions;
11 10
 
12 11
 class JSONTextTest extends SapphireTest
13 12
 {
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/backends/PostgresJSONBackend.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
 
80 80
         $keys = array_keys($operandAsArray);
81 81
         $vals = array_values($operandAsArray);
82
-        if (count($keys) >1 || count($vals) >1) {
82
+        if (count($keys) > 1 || count($vals) > 1) {
83 83
             $msg = 'Sorry. I can\'t handle complex operands.';
84 84
             throw new JSONTextException($msg);
85 85
         }
Please login to merge, or discard this patch.