From 76b0575b9776f1321bbe5a2bc96dead5fa9d961d Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 31 Aug 2022 13:41:08 +0000 Subject: [PATCH] Coding Standards: Use more consistent formatting in `wp-includes/class-json.php`. As an adopted library that does not follow the WordPress Coding Standards, the file ended with a mix of tab and spaces as part of maintenance updates over the years. This commit standardizes on spaces for now, to bring some consistency while minimizing the number of changes. Includes moving all the declared properties to the top of the class. Follow-up to [11875], [11877], [23376], [32990], [46377], [54037]. See #55647. Built from https://develop.svn.wordpress.org/trunk@54038 git-svn-id: http://core.svn.wordpress.org/trunk@53597 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-json.php | 93 +++++++++++++++++++------------------- wp-includes/version.php | 2 +- 2 files changed, 48 insertions(+), 47 deletions(-) diff --git a/wp-includes/class-json.php b/wp-includes/class-json.php index 9d0f0adaad..9eca6f4b57 100644 --- a/wp-includes/class-json.php +++ b/wp-includes/class-json.php @@ -126,7 +126,12 @@ class Services_JSON * * @var int */ - public $use; + public $use; + + // private - cache the mbstring lookup results.. + var $_mb_strlen = false; + var $_mb_substr = false; + var $_mb_convert_encoding = false; /** * constructs a new JSON instance @@ -161,22 +166,18 @@ class Services_JSON $this->_mb_substr = function_exists('mb_substr'); } - /** - * PHP4 constructor. + /** + * PHP4 constructor. * * @deprecated 5.3.0 Use __construct() instead. * * @see Services_JSON::__construct() - */ - public function Services_JSON( $use = 0 ) { - _deprecated_constructor( 'Services_JSON', '5.3.0', get_class( $this ) ); - self::__construct( $use ); - } - // private - cache the mbstring lookup results.. - var $_mb_strlen = false; - var $_mb_substr = false; - var $_mb_convert_encoding = false; - + */ + public function Services_JSON( $use = 0 ) { + _deprecated_constructor( 'Services_JSON', '5.3.0', get_class( $this ) ); + self::__construct( $use ); + } + /** * convert a string from one UTF-16 char to one UTF-8 char * @@ -980,11 +981,11 @@ if (class_exists('PEAR_Error')) { class Services_JSON_Error extends PEAR_Error { - /** - * PHP5 constructor. - * - * @deprecated 5.3.0 Use the PHP native JSON extension instead. - */ + /** + * PHP5 constructor. + * + * @deprecated 5.3.0 Use the PHP native JSON extension instead. + */ function __construct($message = 'unknown error', $code = null, $mode = null, $options = null, $userinfo = null) { @@ -993,18 +994,18 @@ if (class_exists('PEAR_Error')) { parent::PEAR_Error($message, $code, $mode, $options, $userinfo); } - /** - * PHP4 constructor. - * - * @deprecated 5.3.0 Use __construct() instead. - * - * @see Services_JSON_Error::__construct() - */ - public function Services_JSON_Error($message = 'unknown error', $code = null, + /** + * PHP4 constructor. + * + * @deprecated 5.3.0 Use __construct() instead. + * + * @see Services_JSON_Error::__construct() + */ + public function Services_JSON_Error($message = 'unknown error', $code = null, $mode = null, $options = null, $userinfo = null) { - _deprecated_constructor( 'Services_JSON_Error', '5.3.0', get_class( $this ) ); - self::__construct($message, $code, $mode, $options, $userinfo); - } + _deprecated_constructor( 'Services_JSON_Error', '5.3.0', get_class( $this ) ); + self::__construct($message, $code, $mode, $options, $userinfo); + } } } else { @@ -1014,29 +1015,29 @@ if (class_exists('PEAR_Error')) { */ class Services_JSON_Error { - /** - * PHP5 constructor. - * - * @deprecated 5.3.0 Use the PHP native JSON extension instead. - */ + /** + * PHP5 constructor. + * + * @deprecated 5.3.0 Use the PHP native JSON extension instead. + */ function __construct( $message = 'unknown error', $code = null, $mode = null, $options = null, $userinfo = null ) { _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' ); } - /** - * PHP4 constructor. - * - * @deprecated 5.3.0 Use __construct() instead. - * - * @see Services_JSON_Error::__construct() - */ - public function Services_JSON_Error( $message = 'unknown error', $code = null, - $mode = null, $options = null, $userinfo = null ) { - _deprecated_constructor( 'Services_JSON_Error', '5.3.0', get_class( $this ) ); - self::__construct( $message, $code, $mode, $options, $userinfo ); - } + /** + * PHP4 constructor. + * + * @deprecated 5.3.0 Use __construct() instead. + * + * @see Services_JSON_Error::__construct() + */ + public function Services_JSON_Error( $message = 'unknown error', $code = null, + $mode = null, $options = null, $userinfo = null ) { + _deprecated_constructor( 'Services_JSON_Error', '5.3.0', get_class( $this ) ); + self::__construct( $message, $code, $mode, $options, $userinfo ); + } } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 975219b838..eb48ed537e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-alpha-54037'; +$wp_version = '6.1-alpha-54038'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.