From bc01761221384c0bbac0297d38e85bcaa6286a9a Mon Sep 17 00:00:00 2001 From: Sean Molenaar Date: Mon, 28 Sep 2020 21:07:24 +0200 Subject: Fix repair step and test it Signed-off-by: Sean Molenaar --- lib/Fetcher/YoutubeFetcher.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'lib/Fetcher/YoutubeFetcher.php') diff --git a/lib/Fetcher/YoutubeFetcher.php b/lib/Fetcher/YoutubeFetcher.php index 85aad5d59..67a4d5afa 100644 --- a/lib/Fetcher/YoutubeFetcher.php +++ b/lib/Fetcher/YoutubeFetcher.php @@ -22,7 +22,14 @@ class YoutubeFetcher implements IFeedFetcher } - private function buildUrl($url) + /** + * Build YouTube URL + * + * @param string $url + * + * @return string + */ + private function buildUrl(string $url) { $baseRegex = '%(?:https?://|//)?(?:www.)?youtube.com'; $playRegex = $baseRegex . '.*?list=([^&]*)%'; @@ -54,8 +61,14 @@ class YoutubeFetcher implements IFeedFetcher * * @inheritdoc */ - public function fetch(string $url, bool $favicon, $lastModified, bool $fullTextEnabled, $user, $password): array - { + public function fetch( + string $url, + bool $favicon, + ?string $lastModified, + bool $fullTextEnabled, + ?string $user, + ?string $password + ): array { $transformedUrl = $this->buildUrl($url); $result = $this->feedFetcher->fetch( -- cgit v1.2.3