@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | public function find($params = [], $oneItem = false) |
45 | 45 | { |
46 | - if(is_int($params)) { |
|
46 | + if (is_int($params)) { |
|
47 | 47 | $params = [ |
48 | 48 | 'id' => $params |
49 | 49 | ]; |
@@ -54,13 +54,13 @@ discard block |
||
54 | 54 | $values = []; |
55 | 55 | |
56 | 56 | sort($fields); |
57 | - foreach($fields as $field) { |
|
57 | + foreach ($fields as $field) { |
|
58 | 58 | $values[] = $params[$field]; |
59 | 59 | } |
60 | 60 | |
61 | 61 | $index = implode('_', $fields); |
62 | 62 | |
63 | - if(!$index) { |
|
63 | + if (!$index) { |
|
64 | 64 | $index = 'id'; |
65 | 65 | } |
66 | 66 | |
@@ -109,11 +109,11 @@ discard block |
||
109 | 109 | $tuple = $this->type->encode($entity->toArray()); |
110 | 110 | |
111 | 111 | // normalize tuple |
112 | - if(array_values($tuple) != $tuple) { |
|
112 | + if (array_values($tuple) != $tuple) { |
|
113 | 113 | // index was skipped |
114 | 114 | $max = max(array_keys($tuple)); |
115 | - foreach(range(0, $max) as $index) { |
|
116 | - if(!array_key_exists($index, $tuple)) { |
|
115 | + foreach (range(0, $max) as $index) { |
|
116 | + if (!array_key_exists($index, $tuple)) { |
|
117 | 117 | $tuple[$index] = null; |
118 | 118 | } |
119 | 119 | } |