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
This commit is contained in:
Sergey Biryukov 2022-08-31 13:41:08 +00:00
parent b251f368e0
commit 76b0575b97
2 changed files with 48 additions and 47 deletions

View File

@ -126,7 +126,12 @@ class Services_JSON
* *
* @var int * @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 * constructs a new JSON instance
@ -161,22 +166,18 @@ class Services_JSON
$this->_mb_substr = function_exists('mb_substr'); $this->_mb_substr = function_exists('mb_substr');
} }
/** /**
* PHP4 constructor. * PHP4 constructor.
* *
* @deprecated 5.3.0 Use __construct() instead. * @deprecated 5.3.0 Use __construct() instead.
* *
* @see Services_JSON::__construct() * @see Services_JSON::__construct()
*/ */
public function Services_JSON( $use = 0 ) { public function Services_JSON( $use = 0 ) {
_deprecated_constructor( 'Services_JSON', '5.3.0', get_class( $this ) ); _deprecated_constructor( 'Services_JSON', '5.3.0', get_class( $this ) );
self::__construct( $use ); self::__construct( $use );
} }
// private - cache the mbstring lookup results..
var $_mb_strlen = false;
var $_mb_substr = false;
var $_mb_convert_encoding = false;
/** /**
* convert a string from one UTF-16 char to one UTF-8 char * 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 class Services_JSON_Error extends PEAR_Error
{ {
/** /**
* PHP5 constructor. * PHP5 constructor.
* *
* @deprecated 5.3.0 Use the PHP native JSON extension instead. * @deprecated 5.3.0 Use the PHP native JSON extension instead.
*/ */
function __construct($message = 'unknown error', $code = null, function __construct($message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null) $mode = null, $options = null, $userinfo = null)
{ {
@ -993,18 +994,18 @@ if (class_exists('PEAR_Error')) {
parent::PEAR_Error($message, $code, $mode, $options, $userinfo); parent::PEAR_Error($message, $code, $mode, $options, $userinfo);
} }
/** /**
* PHP4 constructor. * PHP4 constructor.
* *
* @deprecated 5.3.0 Use __construct() instead. * @deprecated 5.3.0 Use __construct() instead.
* *
* @see Services_JSON_Error::__construct() * @see Services_JSON_Error::__construct()
*/ */
public function Services_JSON_Error($message = 'unknown error', $code = null, public function Services_JSON_Error($message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null) { $mode = null, $options = null, $userinfo = null) {
_deprecated_constructor( 'Services_JSON_Error', '5.3.0', get_class( $this ) ); _deprecated_constructor( 'Services_JSON_Error', '5.3.0', get_class( $this ) );
self::__construct($message, $code, $mode, $options, $userinfo); self::__construct($message, $code, $mode, $options, $userinfo);
} }
} }
} else { } else {
@ -1014,29 +1015,29 @@ if (class_exists('PEAR_Error')) {
*/ */
class Services_JSON_Error class Services_JSON_Error
{ {
/** /**
* PHP5 constructor. * PHP5 constructor.
* *
* @deprecated 5.3.0 Use the PHP native JSON extension instead. * @deprecated 5.3.0 Use the PHP native JSON extension instead.
*/ */
function __construct( $message = 'unknown error', $code = null, function __construct( $message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null ) $mode = null, $options = null, $userinfo = null )
{ {
_deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' ); _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' );
} }
/** /**
* PHP4 constructor. * PHP4 constructor.
* *
* @deprecated 5.3.0 Use __construct() instead. * @deprecated 5.3.0 Use __construct() instead.
* *
* @see Services_JSON_Error::__construct() * @see Services_JSON_Error::__construct()
*/ */
public function Services_JSON_Error( $message = 'unknown error', $code = null, public function Services_JSON_Error( $message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null ) { $mode = null, $options = null, $userinfo = null ) {
_deprecated_constructor( 'Services_JSON_Error', '5.3.0', get_class( $this ) ); _deprecated_constructor( 'Services_JSON_Error', '5.3.0', get_class( $this ) );
self::__construct( $message, $code, $mode, $options, $userinfo ); self::__construct( $message, $code, $mode, $options, $userinfo );
} }
} }
} }

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @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. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.