Skip to content

Commit

Permalink
Merge pull request #15 from Tpt/Tpt-getOffsetWidthDefault
Browse files Browse the repository at this point in the history
 Renames ArrayConnection::getOffsetWidthDefault to ArrayConnection::getOffsetWithDefault
  • Loading branch information
ivome committed Feb 23, 2018
2 parents 219d391 + 903f946 commit 694ad2f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Connection/ArrayConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static function cursorToOffset($cursor)
* to use; if the cursor contains a valid offset, that will be used,
* otherwise it will be the default.
*/
public static function getOffsetWidthDefault($cursor, $defaultOffset)
public static function getOffsetWithDefault($cursor, $defaultOffset)
{
if ($cursor == null){
return $defaultOffset;
Expand Down Expand Up @@ -84,8 +84,8 @@ public static function connectionFromArraySlice(array $arraySlice, $args, $meta)
$sliceStart = self::getArrayValueSafe($meta, 'sliceStart');
$arrayLength = self::getArrayValueSafe($meta, 'arrayLength');
$sliceEnd = $sliceStart + count($arraySlice);
$beforeOffset = self::getOffsetWidthDefault($before, $arrayLength);
$afterOffset = self::getOffsetWidthDefault($after, -1);
$beforeOffset = self::getOffsetWithDefault($before, $arrayLength);
$afterOffset = self::getOffsetWithDefault($after, -1);

$startOffset = max([
$sliceStart - 1,
Expand Down Expand Up @@ -175,4 +175,4 @@ protected static function getArrayValueSafe(array $array, $key)
{
return array_key_exists($key, $array) ? $array[$key] : null;
}
}
}

0 comments on commit 694ad2f

Please sign in to comment.