Skip to content

Commit b7ebf47

Browse files
authored
Fix PHP 8.4 compatibility issues
1 parent 322a668 commit b7ebf47

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

arrays.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Plugin Name: Arrays
44
* Description: Arrays library with a plugin bootstrap file for automated testing.
5-
* Version: 1.0.0
5+
* Version: 1.3.4
66
* Author: StellarWP
77
* Author URI: https://stellarwp.com
88
*/

src/Arrays/Arr.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ public static function filter_prefixed( array $array, string $prefix ): array {
345345
*
346346
* @return mixed
347347
*/
348-
public static function first( $array, callable $callback = null, $default = null ) {
348+
public static function first( $array, callable ?$callback = null, $default = null ) {
349349
if ( is_null( $callback ) ) {
350350
if ( empty( $array ) ) {
351351
return self::value( $default );
@@ -707,7 +707,7 @@ public static function join( $array, $glue, $finalGlue = '' ) {
707707
*
708708
* @return mixed
709709
*/
710-
public static function last( $array, callable $callback = null, $default = null ) {
710+
public static function last( $array, callable ?$callback = null, $default = null ) {
711711
if ( is_null( $callback ) ) {
712712
return empty( $array ) ? self::value( $default ) : end( $array );
713713
}

0 commit comments

Comments
 (0)