Make WordPress Core

Changeset 54038


Ignore:
Timestamp:
08/31/2022 01:39:33 PM (22 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-json.php

    r54037 r54038  
    127127    * @var int
    128128    */
    129    public $use;
     129    public $use;
     130
     131    // private - cache the mbstring lookup results..
     132    var $_mb_strlen = false;
     133    var $_mb_substr = false;
     134    var $_mb_convert_encoding = false;
    130135
    131136   /**
     
    162167    }
    163168
    164     /**
    165     * PHP4 constructor.
     169    /**
     170    * PHP4 constructor.
    166171     *
    167172     * @deprecated 5.3.0 Use __construct() instead.
    168173     *
    169174     * @see Services_JSON::__construct()
    170      */
    171     public function Services_JSON( $use = 0 ) {
    172         _deprecated_constructor( 'Services_JSON', '5.3.0', get_class( $this ) );
    173         self::__construct( $use );
    174     }
    175     // private - cache the mbstring lookup results..
    176     var $_mb_strlen = false;
    177     var $_mb_substr = false;
    178     var $_mb_convert_encoding = false;
    179    
     175     */
     176    public function Services_JSON( $use = 0 ) {
     177        _deprecated_constructor( 'Services_JSON', '5.3.0', get_class( $this ) );
     178        self::__construct( $use );
     179    }
     180
    180181   /**
    181182    * convert a string from one UTF-16 char to one UTF-8 char
     
    981982    class Services_JSON_Error extends PEAR_Error
    982983    {
    983         /**
    984          * PHP5 constructor.
    985          *
    986          * @deprecated 5.3.0 Use the PHP native JSON extension instead.
    987          */
     984        /**
     985         * PHP5 constructor.
     986         *
     987         * @deprecated 5.3.0 Use the PHP native JSON extension instead.
     988         */
    988989        function __construct($message = 'unknown error', $code = null,
    989990                                     $mode = null, $options = null, $userinfo = null)
     
    994995        }
    995996
    996         /**
    997          * PHP4 constructor.
    998          *
    999          * @deprecated 5.3.0 Use __construct() instead.
    1000          *
    1001          * @see Services_JSON_Error::__construct()
    1002          */
    1003         public function Services_JSON_Error($message = 'unknown error', $code = null,
     997        /**
     998         * PHP4 constructor.
     999         *
     1000         * @deprecated 5.3.0 Use __construct() instead.
     1001         *
     1002         * @see Services_JSON_Error::__construct()
     1003         */
     1004        public function Services_JSON_Error($message = 'unknown error', $code = null,
    10041005                                     $mode = null, $options = null, $userinfo = null) {
    1005             _deprecated_constructor( 'Services_JSON_Error', '5.3.0', get_class( $this ) );
    1006             self::__construct($message, $code, $mode, $options, $userinfo);
    1007         }
     1006            _deprecated_constructor( 'Services_JSON_Error', '5.3.0', get_class( $this ) );
     1007            self::__construct($message, $code, $mode, $options, $userinfo);
     1008        }
    10081009    }
    10091010
     
    10151016    class Services_JSON_Error
    10161017    {
    1017         /**
    1018          * PHP5 constructor.
    1019          *
    1020          * @deprecated 5.3.0 Use the PHP native JSON extension instead.
    1021          */
     1018        /**
     1019         * PHP5 constructor.
     1020         *
     1021         * @deprecated 5.3.0 Use the PHP native JSON extension instead.
     1022         */
    10221023        function __construct( $message = 'unknown error', $code = null,
    10231024                                     $mode = null, $options = null, $userinfo = null )
     
    10261027        }
    10271028
    1028         /**
    1029          * PHP4 constructor.
    1030          *
    1031          * @deprecated 5.3.0 Use __construct() instead.
    1032          *
    1033          * @see Services_JSON_Error::__construct()
    1034          */
    1035         public function Services_JSON_Error( $message = 'unknown error', $code = null,
    1036                                          $mode = null, $options = null, $userinfo = null ) {
    1037             _deprecated_constructor( 'Services_JSON_Error', '5.3.0', get_class( $this ) );
    1038             self::__construct( $message, $code, $mode, $options, $userinfo );
    1039         }
     1029        /**
     1030         * PHP4 constructor.
     1031         *
     1032         * @deprecated 5.3.0 Use __construct() instead.
     1033         *
     1034         * @see Services_JSON_Error::__construct()
     1035         */
     1036        public function Services_JSON_Error( $message = 'unknown error', $code = null,
     1037                                         $mode = null, $options = null, $userinfo = null ) {
     1038            _deprecated_constructor( 'Services_JSON_Error', '5.3.0', get_class( $this ) );
     1039            self::__construct( $message, $code, $mode, $options, $userinfo );
     1040        }
    10401041    }
    10411042
Note: See TracChangeset for help on using the changeset viewer.