Skip to content

Commit

Permalink
兼容性调整
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Oct 16, 2024
1 parent d554a0a commit 1bb0392
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/helper/Arr.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public static function exists($array, $key)
* @param mixed $default
* @return mixed
*/
public static function first($array, callable $callback = null, $default = null)
public static function first($array, ?callable $callback = null, $default = null)
{
if (is_null($callback)) {
if (empty($array)) {
Expand Down Expand Up @@ -196,7 +196,7 @@ public static function first($array, callable $callback = null, $default = null)
* @param mixed $default
* @return mixed
*/
public static function last($array, callable $callback = null, $default = null)
public static function last($array, ?callable $callback = null, $default = null)
{
if (is_null($callback)) {
return empty($array) ? value($default) : end($array);
Expand Down
2 changes: 1 addition & 1 deletion src/helper/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public static function length(string $value): int
* @param int|null $length
* @return string
*/
public static function substr(string $string, int $start, int $length = null): string
public static function substr(string $string, int $start, ?int $length = null): string
{
return mb_substr($string, $start, $length, 'UTF-8');
}
Expand Down

0 comments on commit 1bb0392

Please sign in to comment.