Changeset 59141 for trunk/src/wp-includes/SimplePie/src/Rating.php
- Timestamp:
- 09/30/2024 10:48:16 PM (8 months ago)
- Location:
- trunk/src/wp-includes/SimplePie/src
- Files:
-
- 1 added
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/SimplePie/src/Rating.php
r59140 r59141 1 1 <?php 2 2 3 /** 3 4 * SimplePie … … 6 7 * Takes the hard work out of managing a complete RSS/Atom solution. 7 8 * 8 * Copyright (c) 2004-20 16, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors9 * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors 9 10 * All rights reserved. 10 11 * … … 42 43 */ 43 44 45 namespace SimplePie; 46 44 47 /** 45 48 * Handles `<media:rating>` or `<itunes:explicit>` tags as defined in Media RSS and iTunes RSS respectively 46 49 * 47 * Used by {@see SimplePie_Enclosure::get_rating()} and {@see SimplePie_Enclosure::get_ratings()}50 * Used by {@see \SimplePie\Enclosure::get_rating()} and {@see \SimplePie\Enclosure::get_ratings()} 48 51 * 49 * This class can be overloaded with {@see SimplePie::set_rating_class()}52 * This class can be overloaded with {@see \SimplePie\SimplePie::set_rating_class()} 50 53 * 51 54 * @package SimplePie 52 55 * @subpackage API 53 56 */ 54 class SimplePie_Rating57 class Rating 55 58 { 56 57 58 59 60 61 62 var$scheme;59 /** 60 * Rating scheme 61 * 62 * @var string 63 * @see get_scheme() 64 */ 65 public $scheme; 63 66 64 65 66 67 68 69 70 var$value;67 /** 68 * Rating value 69 * 70 * @var string 71 * @see get_value() 72 */ 73 public $value; 71 74 72 73 74 75 76 77 78 79 80 81 82 75 /** 76 * Constructor, used to input the data 77 * 78 * For documentation on all the parameters, see the corresponding 79 * properties and their accessors 80 */ 81 public function __construct($scheme = null, $value = null) 82 { 83 $this->scheme = $scheme; 84 $this->value = $value; 85 } 83 86 84 85 86 87 88 89 90 91 92 93 87 /** 88 * String-ified version 89 * 90 * @return string 91 */ 92 public function __toString() 93 { 94 // There is no $this->data here 95 return md5(serialize($this)); 96 } 94 97 95 /** 96 * Get the organizational scheme for the rating 97 * 98 * @return string|null 99 */ 100 public function get_scheme() 101 { 102 if ($this->scheme !== null) 103 { 104 return $this->scheme; 105 } 98 /** 99 * Get the organizational scheme for the rating 100 * 101 * @return string|null 102 */ 103 public function get_scheme() 104 { 105 if ($this->scheme !== null) { 106 return $this->scheme; 107 } 106 108 107 108 109 return null; 110 } 109 111 110 /** 111 * Get the value of the rating 112 * 113 * @return string|null 114 */ 115 public function get_value() 116 { 117 if ($this->value !== null) 118 { 119 return $this->value; 120 } 112 /** 113 * Get the value of the rating 114 * 115 * @return string|null 116 */ 117 public function get_value() 118 { 119 if ($this->value !== null) { 120 return $this->value; 121 } 121 122 122 123 123 return null; 124 } 124 125 } 126 127 class_alias('SimplePie\Rating', 'SimplePie_Rating');
Note: See TracChangeset
for help on using the changeset viewer.