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
*/
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 );
}
}
}

View File

@ -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.