@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public static function transformPostgresTextArrayToPHPArray($postgresArray) |
21 | 21 | { |
22 | - $transform = function ($textArrayToTransform) use (&$transform) { |
|
22 | + $transform = function($textArrayToTransform) use (&$transform) { |
|
23 | 23 | $phpArray = str_getcsv(trim($textArrayToTransform, '{}')); |
24 | 24 | foreach ($phpArray as $i => $text) { |
25 | 25 | if ($text === null) { |
@@ -28,16 +28,16 @@ discard block |
||
28 | 28 | break; |
29 | 29 | } |
30 | 30 | |
31 | - $isInteger = is_numeric($text) && ''.(int) $text === $text; |
|
31 | + $isInteger = is_numeric($text) && '' . (int)$text === $text; |
|
32 | 32 | if ($isInteger) { |
33 | - $phpArray[$i] = (int) $text; |
|
33 | + $phpArray[$i] = (int)$text; |
|
34 | 34 | |
35 | 35 | continue; |
36 | 36 | } |
37 | 37 | |
38 | - $isFloat = is_numeric($text) && ''.(float) $text === $text; |
|
38 | + $isFloat = is_numeric($text) && '' . (float)$text === $text; |
|
39 | 39 | if ($isFloat) { |
40 | - $phpArray[$i] = (float) $text; |
|
40 | + $phpArray[$i] = (float)$text; |
|
41 | 41 | |
42 | 42 | continue; |
43 | 43 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public static function transformPHPArrayToPostgresTextArray(array $phpArray) |
62 | 62 | { |
63 | - $transform = function (array $phpArrayToTransform) use (&$transform) { |
|
63 | + $transform = function(array $phpArrayToTransform) use (&$transform) { |
|
64 | 64 | $result = []; |
65 | 65 | foreach ($phpArrayToTransform as $text) { |
66 | 66 | if (is_array($text)) { |
@@ -74,12 +74,12 @@ discard block |
||
74 | 74 | } elseif (empty($text)) { |
75 | 75 | $escapedText = ''; |
76 | 76 | } else { |
77 | - $escapedText = '"'.str_replace('"', '\"', $text).'"'; |
|
77 | + $escapedText = '"' . str_replace('"', '\"', $text) . '"'; |
|
78 | 78 | } |
79 | 79 | $result[] = $escapedText; |
80 | 80 | } |
81 | 81 | |
82 | - return '{'.implode(',', $result).'}'; |
|
82 | + return '{' . implode(',', $result) . '}'; |
|
83 | 83 | }; |
84 | 84 | |
85 | 85 | return $transform($phpArray); |
@@ -39,7 +39,7 @@ |
||
39 | 39 | $trimmedPostgresArray = mb_substr($postgresArray, 2, -2); |
40 | 40 | $phpArray = explode('},{', $trimmedPostgresArray); |
41 | 41 | foreach ($phpArray as &$item) { |
42 | - $item = '{'.$item.'}'; |
|
42 | + $item = '{' . $item . '}'; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | return $phpArray; |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function isValidArrayItemForDatabase($item) |
23 | 23 | { |
24 | - return (is_int($item) || is_string($item)) && preg_match('/^-?[0-9]+$/', (string) $item); |
|
24 | + return (is_int($item) || is_string($item)) && preg_match('/^-?[0-9]+$/', (string)$item); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -29,6 +29,6 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function transformArrayItemForPHP($item) |
31 | 31 | { |
32 | - return (int) $item; |
|
32 | + return (int)$item; |
|
33 | 33 | } |
34 | 34 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | $item = $this->transformArrayItemForPostgres($item); |
46 | 46 | } |
47 | 47 | |
48 | - return '{'.implode(',', $phpArray).'}'; |
|
48 | + return '{' . implode(',', $phpArray) . '}'; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |