WordPress.org

Make WordPress Core

Ticket #47699: 47699-add-deprecated-docblock-tags.patch

File 47699-add-deprecated-docblock-tags.patch, 7.4 KB (added by jrf, 12 months ago)

Services_Json: add @deprecated tags - I'd neglected to do so in the previous patch as committed in [46205]

  • src/wp-includes/class-json.php

    From df8ad5d4915c4b66a249914c2e14ba4ffb3ff61f Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Mon, 30 Sep 2019 03:58:51 +0200
    Subject: [PATCH] Services_Json: add @deprecated tags
    
    ---
     src/wp-includes/class-json.php | 68 +++++++++++++++++++++++++++++-----
     1 file changed, 58 insertions(+), 10 deletions(-)
    
    diff --git a/src/wp-includes/class-json.php b/src/wp-includes/class-json.php
    index b1d7a31bad..30254cd664 100644
    a b class Services_JSON 
    124124   /**
    125125    * constructs a new JSON instance
    126126    *
     127    * @deprecated 5.3.0 Use the PHP native JSON extension instead.
     128    *
    127129    * @param    int     $use    object behavior flags; combine with boolean-OR
    128130    *
    129131    *                           possible values:
    class Services_JSON 
    154156
    155157        /**
    156158         * PHP4 constructor.
     159     *
     160     * @deprecated 5.3.0 Use __construct() instead.
     161     *
     162     * @see __construct()
    157163         */
    158164        public function Services_JSON( $use = 0 ) {
    159165                _deprecated_constructor( 'Services_JSON', '5.3.0', get_class( $this ) );
    class Services_JSON 
    171177    * provides a slower PHP-only method for installations
    172178    * that lack the multibye string extension.
    173179    *
     180    * @deprecated 5.3.0 Use the PHP native JSON extension instead.
     181    *
    174182    * @param    string  $utf16  UTF-16 character
    175183    * @return   string  UTF-8 character
    176184    * @access   private
    class Services_JSON 
    217225    * provides a slower PHP-only method for installations
    218226    * that lack the multibyte string extension.
    219227    *
     228    * @deprecated 5.3.0 Use the PHP native JSON extension instead.
     229    *
    220230    * @param    string  $utf8   UTF-8 character
    221231    * @return   string  UTF-16 character
    222232    * @access   private
    class Services_JSON 
    259269   /**
    260270    * encodes an arbitrary variable into JSON format (and sends JSON Header)
    261271    *
     272    * @deprecated 5.3.0 Use the PHP native JSON extension instead.
     273    *
    262274    * @param    mixed   $var    any number, boolean, string, array, or object to be encoded.
    263275    *                           see argument 1 to Services_JSON() above for array-parsing behavior.
    264276    *                           if var is a string, note that encode() always expects it
    class Services_JSON 
    277289    /**
    278290    * encodes an arbitrary variable into JSON format without JSON Header - warning - may allow XSS!!!!)
    279291    *
     292    * @deprecated 5.3.0 Use the PHP native JSON extension instead.
     293    *
    280294    * @param    mixed   $var    any number, boolean, string, array, or object to be encoded.
    281295    *                           see argument 1 to Services_JSON() above for array-parsing behavior.
    282296    *                           if var is a string, note that encode() always expects it
    class Services_JSON 
    300314    /**
    301315    * PRIVATE CODE that does the work of encodes an arbitrary variable into JSON format
    302316    *
     317    * @deprecated 5.3.0 Use the PHP native JSON extension instead.
     318    *
    303319    * @param    mixed   $var    any number, boolean, string, array, or object to be encoded.
    304320    *                           see argument 1 to Services_JSON() above for array-parsing behavior.
    305321    *                           if var is a string, note that encode() always expects it
    class Services_JSON 
    545561   /**
    546562    * array-walking function for use in generating JSON-formatted name-value pairs
    547563    *
     564    * @deprecated 5.3.0 Use the PHP native JSON extension instead.
     565    *
    548566    * @param    string  $name   name of key to use
    549567    * @param    mixed   $value  reference to an array element to be encoded
    550568    *
    class Services_JSON 
    567585   /**
    568586    * reduce a string by removing leading and trailing comments and whitespace
    569587    *
     588    * @deprecated 5.3.0 Use the PHP native JSON extension instead.
     589    *
    570590    * @param    $str    string      string value to strip of comments and whitespace
    571591    *
    572592    * @return   string  string value stripped of comments and whitespace
    class Services_JSON 
    596616   /**
    597617    * decodes a JSON string into appropriate variable
    598618    *
     619    * @deprecated 5.3.0 Use the PHP native JSON extension instead.
     620    *
    599621    * @param    string  $str    JSON-formatted string
    600622    *
    601623    * @return   mixed   number, boolean, string, array, or object
    class Services_JSON 
    886908    }
    887909
    888910    /**
     911     * @deprecated 5.3.0 Use the PHP native JSON extension instead.
     912     *
    889913     * @todo Ultimately, this should just call PEAR::isError()
    890914     */
    891915    function isError($data, $code = null)
    class Services_JSON 
    903927    }
    904928   
    905929    /**
    906     * Calculates length of string in bytes
    907     * @param string
    908     * @return integer length
    909     */
     930     * Calculates length of string in bytes
     931     *
     932     * @deprecated 5.3.0 Use the PHP native JSON extension instead.
     933     *
     934     * @param string
     935     * @return integer length
     936     */
    910937    function strlen8( $str )
    911938    {
    912939        _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' );
    class Services_JSON 
    918945    }
    919946   
    920947    /**
    921     * Returns part of a string, interpreting $start and $length as number of bytes.
    922     * @param string
    923     * @param integer start
    924     * @param integer length
    925     * @return integer length
    926     */
     948     * Returns part of a string, interpreting $start and $length as number of bytes.
     949     *
     950     * @deprecated 5.3.0 Use the PHP native JSON extension instead.
     951     *
     952     * @param string
     953     * @param integer start
     954     * @param integer length
     955     * @return integer length
     956     */
    927957    function substr8( $string, $start, $length=false )
    928958    {
    929959        _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' );
    if (class_exists('PEAR_Error')) { 
    943973
    944974    class Services_JSON_Error extends PEAR_Error
    945975    {
     976            /**
     977             * PHP5 constructor.
     978             *
     979             * @deprecated 5.3.0 Use the PHP native JSON extension instead.
     980             */
    946981        function __construct($message = 'unknown error', $code = null,
    947982                                     $mode = null, $options = null, $userinfo = null)
    948983        {
    if (class_exists('PEAR_Error')) { 
    951986            parent::PEAR_Error($message, $code, $mode, $options, $userinfo);
    952987        }
    953988
     989            /**
     990             * PHP4 constructor.
     991             *
     992             * @deprecated 5.3.0 Use __construct() instead.
     993             *
     994             * @see __construct()
     995             */
    954996                public function Services_JSON_Error($message = 'unknown error', $code = null,
    955997                                     $mode = null, $options = null, $userinfo = null) {
    956998                        _deprecated_constructor( 'Services_JSON_Error', '5.3.0', get_class( $this ) );
    if (class_exists('PEAR_Error')) { 
    9671009    {
    9681010            /**
    9691011             * PHP5 constructor.
     1012             *
     1013             * @deprecated 5.3.0 Use the PHP native JSON extension instead.
    9701014             */
    9711015        function __construct( $message = 'unknown error', $code = null,
    9721016                                     $mode = null, $options = null, $userinfo = null )
    if (class_exists('PEAR_Error')) { 
    9761020
    9771021            /**
    9781022             * PHP4 constructor.
     1023             *
     1024             * @deprecated 5.3.0 Use __construct() instead.
     1025             *
     1026             * @see __construct()
    9791027             */
    9801028                public function Services_JSON_Error( $message = 'unknown error', $code = null,
    9811029                                             $mode = null, $options = null, $userinfo = null ) {