From e4a673aae5ff37533ce635d1f5d1f856f77041e0 Mon Sep 17 00:00:00 2001 From: boyska Date: Tue, 5 Mar 2024 19:54:37 +0100 Subject: [PATCH] [M3uFormat] type hinting and comments --- formats/M3uFormat.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/formats/M3uFormat.php b/formats/M3uFormat.php index 3c580c49..f81a2481 100644 --- a/formats/M3uFormat.php +++ b/formats/M3uFormat.php @@ -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; $parts = explode(':', $duration_string); @@ -50,7 +54,7 @@ class M3uItem public $url = null; public $bytes = null; - public function render() + public function render(): string { if ($this->url === null) { return '';