Skip to content

Commit 94b61bb

Browse files
committed
formatting
1 parent 8b015c4 commit 94b61bb

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

src/Illuminate/Pagination/AbstractPaginator.php

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,18 @@ abstract class AbstractPaginator implements Htmlable
9494
protected static $currentPageResolver;
9595

9696
/**
97-
* The view factory resolver callback.
97+
* The query string resolver callback.
9898
*
9999
* @var \Closure
100100
*/
101-
protected static $viewFactoryResolver;
101+
protected static $queryStringResolver;
102102

103103
/**
104-
* The with query string resolver callback.
104+
* The view factory resolver callback.
105105
*
106106
* @var \Closure
107107
*/
108-
protected static $queryStringResolver;
108+
protected static $viewFactoryResolver;
109109

110110
/**
111111
* The default pagination view.
@@ -223,29 +223,29 @@ public function appends($key, $value = null)
223223
}
224224

225225
/**
226-
* Add all query string values to the paginator.
226+
* Add an array of query string values.
227227
*
228+
* @param array $keys
228229
* @return $this
229230
*/
230-
public function withQueryString()
231+
protected function appendArray(array $keys)
231232
{
232-
if (isset(static::$queryStringResolver)) {
233-
return $this->appends(call_user_func(static::$queryStringResolver));
233+
foreach ($keys as $key => $value) {
234+
$this->addQuery($key, $value);
234235
}
235236

236237
return $this;
237238
}
238239

239240
/**
240-
* Add an array of query string values.
241+
* Add all current query string values to the paginator.
241242
*
242-
* @param array $keys
243243
* @return $this
244244
*/
245-
protected function appendArray(array $keys)
245+
public function withQueryString()
246246
{
247-
foreach ($keys as $key => $value) {
248-
$this->addQuery($key, $value);
247+
if (isset(static::$queryStringResolver)) {
248+
return $this->appends(call_user_func(static::$queryStringResolver));
249249
}
250250

251251
return $this;
@@ -484,6 +484,17 @@ public static function currentPageResolver(Closure $resolver)
484484
static::$currentPageResolver = $resolver;
485485
}
486486

487+
/**
488+
* Set with query string resolver callback.
489+
*
490+
* @param \Closure $resolver
491+
* @return void
492+
*/
493+
public static function queryStringResolver(Closure $resolver)
494+
{
495+
static::$queryStringResolver = $resolver;
496+
}
497+
487498
/**
488499
* Get an instance of the view factory from the resolver.
489500
*
@@ -505,17 +516,6 @@ public static function viewFactoryResolver(Closure $resolver)
505516
static::$viewFactoryResolver = $resolver;
506517
}
507518

508-
/**
509-
* Set with query string resolver callback.
510-
*
511-
* @param \Closure $resolver
512-
* @return void
513-
*/
514-
public static function withQueryStringResolver(Closure $resolver)
515-
{
516-
static::$queryStringResolver = $resolver;
517-
}
518-
519519
/**
520520
* Set the default pagination view.
521521
*

src/Illuminate/Pagination/PaginationServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function register()
4747
return 1;
4848
});
4949

50-
Paginator::withQueryStringResolver(function () {
50+
Paginator::queryStringResolver(function () {
5151
return $this->app['request']->query();
5252
});
5353
}

0 commit comments

Comments
 (0)