Changeset 59141 for trunk/src/wp-includes/SimplePie/src/Caption.php
- Timestamp:
- 09/30/2024 10:48:16 PM (2 months ago)
- Location:
- trunk/src/wp-includes/SimplePie/src
- Files:
-
- 1 added
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/SimplePie/src/Caption.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; 44 46 45 47 /** 46 48 * Handles `<media:text>` captions as defined in Media RSS. 47 49 * 48 * Used by {@see SimplePie_Enclosure::get_caption()} and {@see SimplePie_Enclosure::get_captions()}50 * Used by {@see \SimplePie\Enclosure::get_caption()} and {@see \SimplePie\Enclosure::get_captions()} 49 51 * 50 * This class can be overloaded with {@see SimplePie::set_caption_class()}52 * This class can be overloaded with {@see \SimplePie\SimplePie::set_caption_class()} 51 53 * 52 54 * @package SimplePie 53 55 * @subpackage API 54 56 */ 55 class SimplePie_Caption57 class Caption 56 58 { 57 58 59 60 61 62 63 var$type;59 /** 60 * Content type 61 * 62 * @var string 63 * @see get_type() 64 */ 65 public $type; 64 66 65 66 67 68 69 70 71 var$lang;67 /** 68 * Language 69 * 70 * @var string 71 * @see get_language() 72 */ 73 public $lang; 72 74 73 74 75 76 77 78 79 var$startTime;75 /** 76 * Start time 77 * 78 * @var string 79 * @see get_starttime() 80 */ 81 public $startTime; 80 82 81 82 83 84 85 86 87 var$endTime;83 /** 84 * End time 85 * 86 * @var string 87 * @see get_endtime() 88 */ 89 public $endTime; 88 90 89 90 91 92 93 94 95 var$text;91 /** 92 * Caption text 93 * 94 * @var string 95 * @see get_text() 96 */ 97 public $text; 96 98 97 98 99 100 101 102 103 104 105 106 107 108 109 110 99 /** 100 * Constructor, used to input the data 101 * 102 * For documentation on all the parameters, see the corresponding 103 * properties and their accessors 104 */ 105 public function __construct($type = null, $lang = null, $startTime = null, $endTime = null, $text = null) 106 { 107 $this->type = $type; 108 $this->lang = $lang; 109 $this->startTime = $startTime; 110 $this->endTime = $endTime; 111 $this->text = $text; 112 } 111 113 112 113 114 115 116 117 118 119 120 121 114 /** 115 * String-ified version 116 * 117 * @return string 118 */ 119 public function __toString() 120 { 121 // There is no $this->data here 122 return md5(serialize($this)); 123 } 122 124 123 /** 124 * Get the end time 125 * 126 * @return string|null Time in the format 'hh:mm:ss.SSS' 127 */ 128 public function get_endtime() 129 { 130 if ($this->endTime !== null) 131 { 132 return $this->endTime; 133 } 125 /** 126 * Get the end time 127 * 128 * @return string|null Time in the format 'hh:mm:ss.SSS' 129 */ 130 public function get_endtime() 131 { 132 if ($this->endTime !== null) { 133 return $this->endTime; 134 } 134 135 135 136 136 return null; 137 } 137 138 138 /** 139 * Get the language 140 * 141 * @link http://tools.ietf.org/html/rfc3066 142 * @return string|null Language code as per RFC 3066 143 */ 144 public function get_language() 145 { 146 if ($this->lang !== null) 147 { 148 return $this->lang; 149 } 139 /** 140 * Get the language 141 * 142 * @link http://tools.ietf.org/html/rfc3066 143 * @return string|null Language code as per RFC 3066 144 */ 145 public function get_language() 146 { 147 if ($this->lang !== null) { 148 return $this->lang; 149 } 150 150 151 152 151 return null; 152 } 153 153 154 /** 155 * Get the start time 156 * 157 * @return string|null Time in the format 'hh:mm:ss.SSS' 158 */ 159 public function get_starttime() 160 { 161 if ($this->startTime !== null) 162 { 163 return $this->startTime; 164 } 154 /** 155 * Get the start time 156 * 157 * @return string|null Time in the format 'hh:mm:ss.SSS' 158 */ 159 public function get_starttime() 160 { 161 if ($this->startTime !== null) { 162 return $this->startTime; 163 } 165 164 166 167 165 return null; 166 } 168 167 169 /** 170 * Get the text of the caption 171 * 172 * @return string|null 173 */ 174 public function get_text() 175 { 176 if ($this->text !== null) 177 { 178 return $this->text; 179 } 168 /** 169 * Get the text of the caption 170 * 171 * @return string|null 172 */ 173 public function get_text() 174 { 175 if ($this->text !== null) { 176 return $this->text; 177 } 180 178 181 182 179 return null; 180 } 183 181 184 /** 185 * Get the content type (not MIME type) 186 * 187 * @return string|null Either 'text' or 'html' 188 */ 189 public function get_type() 190 { 191 if ($this->type !== null) 192 { 193 return $this->type; 194 } 182 /** 183 * Get the content type (not MIME type) 184 * 185 * @return string|null Either 'text' or 'html' 186 */ 187 public function get_type() 188 { 189 if ($this->type !== null) { 190 return $this->type; 191 } 195 192 196 197 193 return null; 194 } 198 195 } 196 197 class_alias('SimplePie\Caption', 'SimplePie_Caption');
Note: See TracChangeset
for help on using the changeset viewer.