mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-05 22:52:49 +08:00
优化PHP8.4兼容性
This commit is contained in:
@@ -263,7 +263,7 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria
|
||||
* @param callable|null $callback 回调函数
|
||||
* @return static
|
||||
*/
|
||||
public function filter(callable $callback = null)
|
||||
public function filter(?callable $callback = null)
|
||||
{
|
||||
return new static(array_filter($this->items, $callback ?: null));
|
||||
}
|
||||
@@ -317,7 +317,7 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria
|
||||
* @param callable|null $callback 回调函数
|
||||
* @return static
|
||||
*/
|
||||
public function sort(callable $callback = null)
|
||||
public function sort(?callable $callback = null)
|
||||
{
|
||||
$items = $this->items;
|
||||
$callback = $callback ?: function ($a, $b) {
|
||||
|
||||
Reference in New Issue
Block a user