[M3uFormat] type hinting and comments

This commit is contained in:
boyska 2024-03-05 19:54:37 +01:00
parent 36f69af043
commit e4a673aae5

View File

@ -33,7 +33,11 @@ class M3uFormat extends FormatAbstract
} }
} }
function parse_duration($duration_string) /*
* parse_duration converts a string like "00:4:20" to 260
* allowing to convert duration as used in the itunes:duration tag to the number of seconds
*/
function parse_duration(string $duration_string): int
{ {
$seconds = 0; $seconds = 0;
$parts = explode(':', $duration_string); $parts = explode(':', $duration_string);
@ -50,7 +54,7 @@ class M3uItem
public $url = null; public $url = null;
public $bytes = null; public $bytes = null;
public function render() public function render(): string
{ {
if ($this->url === null) { if ($this->url === null) {
return ''; return '';