@@ -15,7 +15,9 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | public static function cursorForObjectInConnection($data, $object) |
| 17 | 17 | { |
| 18 | - if (!is_array($data)) return null; |
|
| 18 | + if (!is_array($data)) { |
|
| 19 | + return null; |
|
| 20 | + } |
|
| 19 | 21 | |
| 20 | 22 | $index = array_search($object, $data); |
| 21 | 23 | return $index === false ? null : (string) self::keyToCursor($index); |
@@ -81,8 +83,7 @@ discard block |
||
| 81 | 83 | $key = self::cursorToKey($cursor); |
| 82 | 84 | if (empty($array)) { |
| 83 | 85 | $offset = $key; |
| 84 | - } |
|
| 85 | - else { |
|
| 86 | + } else { |
|
| 86 | 87 | $offset = array_search($key, array_keys($array)); |
| 87 | 88 | } |
| 88 | 89 | |