Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
vanthao03596 authored and actions-user committed Jul 12, 2021
1 parent 1d46023 commit effb493
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/EloquentCursorPaginateMixin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ class EloquentCursorPaginateMixin
{
protected function paginateUsingCursor()
{
return function ($perPage, $columns = ['*'], $cursorName = 'cursor', $cursor = null)
{
return function ($perPage, $columns = ['*'], $cursorName = 'cursor', $cursor = null) {
$cursor = $cursor ?: CursorPaginator::resolveCurrentCursor($cursorName);

$orders = $this->ensureOrderForCursorPagination(! is_null($cursor) && $cursor->pointsToPreviousItems());
Expand Down
1 change: 0 additions & 1 deletion src/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Illuminate\Container\Container;
use Illuminate\Database\Query\Builder as Base;
use Illuminate\Pagination\Paginator;
use Vanthao03596\LaravelCursorPaginate\CursorPaginationException;
use Vanthao03596\LaravelCursorPaginate\CursorPaginator;

class Builder extends Base
Expand Down
9 changes: 6 additions & 3 deletions tests/DatabaseQueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public function testCursorPaginate()
$builder->shouldReceive('get')->once()->andReturnUsing(function () use ($builder, $results) {
$this->assertEquals(
'select * from "foobar" where ("test" > ?) order by "test" asc limit 17',
$builder->toSql());
$builder->toSql()
);
$this->assertEquals(['bar'], $builder->bindings['where']);

return $results;
Expand Down Expand Up @@ -154,7 +155,8 @@ public function testCursorPaginateWithDefaultArguments()
$builder->shouldReceive('get')->once()->andReturnUsing(function () use ($builder, $results) {
$this->assertEquals(
'select * from "foobar" where ("test" > ?) order by "test" asc limit 16',
$builder->toSql());
$builder->toSql()
);
$this->assertEquals(['bar'], $builder->bindings['where']);

return $results;
Expand Down Expand Up @@ -224,7 +226,8 @@ public function testCursorPaginateWithSpecificColumns()
$builder->shouldReceive('get')->once()->andReturnUsing(function () use ($builder, $results) {
$this->assertEquals(
'select * from "foobar" where ("id" > ?) order by "id" asc limit 17',
$builder->toSql());
$builder->toSql()
);
$this->assertEquals([2], $builder->bindings['where']);

return $results;
Expand Down

0 comments on commit effb493

Please sign in to comment.