Make WordPress Core


Ignore:
Timestamp:
09/30/2024 10:48:16 PM (2 months ago)
Author:
SergeyBiryukov
Message:

External Libraries: Update the SimplePie library to version 1.8.0.

The most notable change in this update is that all code is now namespaced and uses PSR-4 classes, though there is a compatibility layer available for extenders using the older class names, so plugin or theme authors directly using SimplePie can decide for themselves when they want to change to using the namespaced names for SimplePie classes.

Note: This commit includes additional fixes for PHP 8.4 compatibility (PR 875, PR 888) from the one-dot-eight branch of SimplePie, which is expected to be released as SimplePie 1.8.1 soon.

References:

Follow-up to [47733], [49176], [52393], [52413].

Props jrf, peterwilsoncc, chaion07, cu121, markparnell, audrasjb, costdev, Presskopp, desrosj, faisal03, mukesh27, SergeyBiryukov.
See #55604.

Location:
trunk/src/wp-includes/SimplePie/src
Files:
1 added
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/SimplePie/src/Credit.php

    r59140 r59141  
    11<?php
     2
    23/**
    34 * SimplePie
     
    67 * Takes the hard work out of managing a complete RSS/Atom solution.
    78 *
    8  * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
     9 * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
    910 * All rights reserved.
    1011 *
     
    4243 */
    4344
     45namespace SimplePie;
     46
    4447/**
    4548 * Handles `<media:credit>` as defined in Media RSS
    4649 *
    47  * Used by {@see SimplePie_Enclosure::get_credit()} and {@see SimplePie_Enclosure::get_credits()}
     50 * Used by {@see \SimplePie\Enclosure::get_credit()} and {@see \SimplePie\Enclosure::get_credits()}
    4851 *
    49  * This class can be overloaded with {@see SimplePie::set_credit_class()}
     52 * This class can be overloaded with {@see \SimplePie\SimplePie::set_credit_class()}
    5053 *
    5154 * @package SimplePie
    5255 * @subpackage API
    5356 */
    54 class SimplePie_Credit
     57class Credit
    5558{
    56     /**
    57     * Credited role
    58     *
    59     * @var string
    60     * @see get_role()
    61     */
    62     var $role;
     59    /**
     60    * Credited role
     61    *
     62    * @var string
     63    * @see get_role()
     64    */
     65    public $role;
    6366
    64     /**
    65     * Organizational scheme
    66     *
    67     * @var string
    68     * @see get_scheme()
    69     */
    70     var $scheme;
     67    /**
     68    * Organizational scheme
     69    *
     70    * @var string
     71    * @see get_scheme()
     72    */
     73    public $scheme;
    7174
    72     /**
    73     * Credited name
    74     *
    75     * @var string
    76     * @see get_name()
    77     */
    78     var $name;
     75    /**
     76    * Credited name
     77    *
     78    * @var string
     79    * @see get_name()
     80    */
     81    public $name;
    7982
    80     /**
    81     * Constructor, used to input the data
    82     *
    83     * For documentation on all the parameters, see the corresponding
    84     * properties and their accessors
    85     */
    86     public function __construct($role = null, $scheme = null, $name = null)
    87     {
    88         $this->role = $role;
    89         $this->scheme = $scheme;
    90         $this->name = $name;
    91     }
     83    /**
     84    * Constructor, used to input the data
     85    *
     86    * For documentation on all the parameters, see the corresponding
     87    * properties and their accessors
     88    */
     89    public function __construct($role = null, $scheme = null, $name = null)
     90    {
     91        $this->role = $role;
     92        $this->scheme = $scheme;
     93        $this->name = $name;
     94    }
    9295
    93     /**
    94     * String-ified version
    95     *
    96     * @return string
    97     */
    98     public function __toString()
    99     {
    100         // There is no $this->data here
    101         return md5(serialize($this));
    102     }
     96    /**
     97    * String-ified version
     98    *
     99    * @return string
     100    */
     101    public function __toString()
     102    {
     103        // There is no $this->data here
     104        return md5(serialize($this));
     105    }
    103106
    104     /**
    105      * Get the role of the person receiving credit
    106      *
    107      * @return string|null
    108      */
    109     public function get_role()
    110     {
    111         if ($this->role !== null)
    112         {
    113             return $this->role;
    114         }
     107    /**
     108     * Get the role of the person receiving credit
     109     *
     110     * @return string|null
     111     */
     112    public function get_role()
     113    {
     114        if ($this->role !== null) {
     115            return $this->role;
     116        }
    115117
    116         return null;
    117     }
     118        return null;
     119    }
    118120
    119     /**
    120      * Get the organizational scheme
    121      *
    122      * @return string|null
    123      */
    124     public function get_scheme()
    125     {
    126         if ($this->scheme !== null)
    127         {
    128             return $this->scheme;
    129         }
     121    /**
     122     * Get the organizational scheme
     123     *
     124     * @return string|null
     125     */
     126    public function get_scheme()
     127    {
     128        if ($this->scheme !== null) {
     129            return $this->scheme;
     130        }
    130131
    131         return null;
    132     }
     132        return null;
     133    }
    133134
    134     /**
    135      * Get the credited person/entity's name
    136      *
    137      * @return string|null
    138      */
    139     public function get_name()
    140     {
    141         if ($this->name !== null)
    142         {
    143             return $this->name;
    144         }
     135    /**
     136     * Get the credited person/entity's name
     137     *
     138     * @return string|null
     139     */
     140    public function get_name()
     141    {
     142        if ($this->name !== null) {
     143            return $this->name;
     144        }
    145145
    146         return null;
    147     }
     146        return null;
     147    }
    148148}
     149
     150class_alias('SimplePie\Credit', 'SimplePie_Credit');
Note: See TracChangeset for help on using the changeset viewer.