mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-14 01:24:27 +00:00
Code Modernization: Fix parameter name mismatches for parent/child classes in WP_Customize_Setting::sanitize().
In each child class: renames the parameter to match the parent's method signature. Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match. Changes for readability: - `@since` clearly specifies the original parameter name and its new name as well as why the change happened. - In methods longer than a single line, the generic parameter is reassigned to the original parameter restoring it for context for use within the method. An inline comment is added to explain why this reassignment is made. Follow-up to [19995], [32806]. Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion. See #51553. git-svn-id: https://develop.svn.wordpress.org/trunk@51783 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -559,7 +559,7 @@ class WP_Customize_Setting {
|
||||
*
|
||||
* @since 3.4.0
|
||||
*
|
||||
* @param string|array $value The value to sanitize.
|
||||
* @param string|array $value The value to sanitize.
|
||||
* @return string|array|null|WP_Error Sanitized value, or `null`/`WP_Error` if invalid.
|
||||
*/
|
||||
public function sanitize( $value ) {
|
||||
|
||||
Reference in New Issue
Block a user