[wp-trac] [WordPress Trac] #56746: Unused function parameters in the class-wp-customize-background-image-setting.php files.

WordPress Trac noreply at wordpress.org
Fri Oct 7 23:03:31 UTC 2022


#56746: Unused function parameters in the class-wp-customize-background-image-
setting.php files.
-----------------------------+-------------------------------
 Reporter:  upadalavipul     |       Owner:  (none)
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  General          |     Version:  trunk
 Severity:  normal           |  Resolution:
 Keywords:  has-patch close  |     Focuses:  coding-standards
-----------------------------+-------------------------------

Comment (by SergeyBiryukov):

 Hi there, thanks for the ticket!

 I believe the proposed patch would cause a warning on PHP 7.x and a fatal
 error on PHP 8.x due to the number of parameters in the child class method
 not matching the number of parameters in the parent class.

 Running this script in the root directory with the patch applied:
 {{{
 require 'wp-load.php';
 require 'wp-includes/class-wp-customize-setting.php';

 $setting = new WP_Customize_Background_Image_Setting( null, '' );
 $setting->update();
 }}}

 I get: `Fatal error: Declaration of
 WP_Customize_Background_Image_Setting::update() must be compatible with
 WP_Customize_Setting::update($value) in wp-includes/customize/class-wp-
 customize-background-image-setting.php on line 32`

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56746#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list