提交的内容

This commit is contained in:
2025-05-12 15:45:02 +08:00
parent 629c4750da
commit b48c692775
3043 changed files with 34732 additions and 60810 deletions

7
vendor/topthink/think-orm/src/Paginator.php vendored Executable file → Normal file
View File

@ -110,7 +110,7 @@ abstract class Paginator implements ArrayAccess, Countable, IteratorAggregate, J
*/
protected static $maker;
public function __construct($items, int $listRows, int $currentPage = 1, int $total = null, bool $simple = false, array $options = [])
public function __construct($items, int $listRows, int $currentPage = 1, ?int $total = null, bool $simple = false, array $options = [])
{
$this->options = array_merge($this->options, $options);
@ -146,7 +146,7 @@ abstract class Paginator implements ArrayAccess, Countable, IteratorAggregate, J
*
* @return Paginator
*/
public static function make($items, int $listRows, int $currentPage = 1, int $total = null, bool $simple = false, array $options = [])
public static function make($items, int $listRows, int $currentPage = 1, ?int $total = null, bool $simple = false, array $options = [])
{
if (isset(static::$maker)) {
return call_user_func(static::$maker, $items, $listRows, $currentPage, $total, $simple, $options);
@ -339,7 +339,7 @@ abstract class Paginator implements ArrayAccess, Countable, IteratorAggregate, J
*
* @return $this
*/
public function fragment(string $fragment = null)
public function fragment(?string $fragment = null)
{
$this->options['fragment'] = $fragment;
@ -531,6 +531,7 @@ abstract class Paginator implements ArrayAccess, Countable, IteratorAggregate, J
'current_page' => $this->currentPage(),
'last_page' => $this->lastPage,
'data' => $this->items->toArray(),
'has_more' => $this->hasMore,
];
}