Skip to content

Commit 1180d79

Browse files
committed
PHP 8.4 deprecation notices.
Signed-off-by: Kev Provance <[email protected]>
1 parent 17a7767 commit 1180d79

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

redux-core/inc/classes/class-redux-class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Redux_Class {
4242
*
4343
* @param ReduxFramework|null $redux Pointer to ReduxFramework object.
4444
*/
45-
public function __construct( ReduxFramework $redux = null ) {
45+
public function __construct( ?ReduxFramework $redux = null ) {
4646
if ( is_object( $redux ) ) {
4747
$this->parent = $redux;
4848
$this->args = $redux->args;

redux-core/inc/classes/class-redux-filesystem.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function __construct( bool $force_no_fs = false ) {
145145
* @return object A single instance of this class.
146146
* @since 1.0.0
147147
*/
148-
public static function get_instance( ReduxFramework $me = null ): ?object {
148+
public static function get_instance( ?ReduxFramework $me = null ): ?object {
149149

150150
// If the single instance hasn't been set, set it now.
151151
if ( null === self::$instance ) {
@@ -524,7 +524,7 @@ public function touch( string $abs_path, int $time = 0, int $atime = 0 ): bool {
524524
*
525525
* @return bool
526526
*/
527-
public function put_contents( string $abs_path, string $contents, string $perms = null ): bool {
527+
public function put_contents( string $abs_path, string $contents, ?string $perms = null ): bool {
528528
$return = false;
529529

530530
if ( ! $this->is_dir( dirname( $abs_path ) ) ) {
@@ -663,7 +663,7 @@ public function unlink( string $abs_path ): bool {
663663
*
664664
* @return bool
665665
*/
666-
public function chmod( string $abs_path, int $perms = null ): bool {
666+
public function chmod( string $abs_path, ?int $perms = null ): bool {
667667
if ( ! $this->file_exists( $abs_path ) ) {
668668
return false;
669669
}
@@ -773,7 +773,7 @@ private function create_index( string $path ) {
773773
*
774774
* @return bool
775775
*/
776-
public function mkdir( string $abs_path, int $perms = null ): bool {
776+
public function mkdir( string $abs_path, ?int $perms = null ): bool {
777777
if ( is_null( $perms ) ) {
778778
$perms = $this->chmod_dir;
779779
}
@@ -968,7 +968,7 @@ public function scandir( string $abs_path, bool $include_hidden = true, bool $re
968968
*
969969
* @return bool
970970
*/
971-
public function move_uploaded_file( string $file, string $destination, int $perms = null ): bool {
971+
public function move_uploaded_file( string $file, string $destination, ?int $perms = null ): bool {
972972
// TODO: look into replicating more functionality from wp_handle_upload().
973973
// phpcs:ignore WordPress.PHP.NoSilencedErrors
974974
$return = @move_uploaded_file( $file, $destination );

redux-core/inc/classes/class-redux-helpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ public static function current_user_can( $caps ): bool { // phpcs:ignore Generic
781781
* user_can( 42, 'edit_page', 17433 ); // Checks if user ID 42 has the 'edit_page' cap for post-ID 17433.
782782
* user_can( 42, array( 'edit_pages', 'edit_posts' ) ); // Checks if user ID 42 has both the 'edit_pages' and 'edit_posts' caps.
783783
*/
784-
public static function user_can( $user, $capabilities, int $object_id = null ): bool {
784+
public static function user_can( $user, $capabilities, ?int $object_id = null ): bool {
785785
static $depth = 0;
786786

787787
if ( $depth >= 30 ) {

redux-core/inc/extensions/color_scheme/color_scheme/inc/class-redux-color-scheme-functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ private static function get_select_names(): array {
208208
*
209209
* @return mixed
210210
*/
211-
public static function get_field( ReduxFramework $redux = null ) {
211+
public static function get_field( ?ReduxFramework $redux = null ) {
212212
if ( ! is_null( $redux ) ) {
213213
self::$parent = $redux;
214214
}

redux-core/inc/extensions/shortcodes/class-redux-shortcodes.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function __construct() {
9292
*
9393
* @return bool|string|null
9494
*/
95-
public function blog_info( $atts = array(), string $content = null ) {
95+
public function blog_info( $atts = array(), ?string $content = null ) {
9696
if ( ! is_array( $atts ) ) {
9797
$atts = array();
9898
}
@@ -146,7 +146,7 @@ public function blog_info( $atts = array(), string $content = null ) {
146146
*
147147
* @return array|bool|string
148148
*/
149-
public function theme_info( array $atts = array(), string $content = null ) {
149+
public function theme_info( array $atts = array(), ?string $content = null ) {
150150
if ( ! is_array( $atts ) ) {
151151
$atts = array();
152152
}
@@ -202,7 +202,7 @@ public function theme_info( array $atts = array(), string $content = null ) {
202202
*
203203
* @return false|string
204204
*/
205-
public function date( $atts = array(), string $content = null ) {
205+
public function date( $atts = array(), ?string $content = null ) {
206206
if ( ! is_array( $atts ) ) {
207207
$atts = array();
208208
}

0 commit comments

Comments
 (0)