diff options
Diffstat (limited to 'lib/Fetcher')
-rwxr-xr-x | lib/Fetcher/FeedFetcher.php | 2 | ||||
-rw-r--r-- | lib/Fetcher/IFeedFetcher.php | 2 | ||||
-rw-r--r-- | lib/Fetcher/YoutubeFetcher.php | 8 |
3 files changed, 8 insertions, 4 deletions
diff --git a/lib/Fetcher/FeedFetcher.php b/lib/Fetcher/FeedFetcher.php index 99d3d90ab..4e93424ba 100755 --- a/lib/Fetcher/FeedFetcher.php +++ b/lib/Fetcher/FeedFetcher.php @@ -64,7 +64,7 @@ class FeedFetcher implements IFeedFetcher * * @return bool */ - public function canHandle($url): bool + public function canHandle(string $url): bool { return true; } diff --git a/lib/Fetcher/IFeedFetcher.php b/lib/Fetcher/IFeedFetcher.php index 6500c2690..ce44ec104 100644 --- a/lib/Fetcher/IFeedFetcher.php +++ b/lib/Fetcher/IFeedFetcher.php @@ -43,5 +43,5 @@ interface IFeedFetcher * @return boolean if the fetcher can handle the url. This fetcher will be * used exclusively to fetch the feed and the items of the page */ - public function canHandle($url): bool; + public function canHandle(string $url): bool; } diff --git a/lib/Fetcher/YoutubeFetcher.php b/lib/Fetcher/YoutubeFetcher.php index 56adaae03..85aad5d59 100644 --- a/lib/Fetcher/YoutubeFetcher.php +++ b/lib/Fetcher/YoutubeFetcher.php @@ -37,9 +37,13 @@ class YoutubeFetcher implements IFeedFetcher /** - * This fetcher handles all the remaining urls therefore always returns true + * Check if the URL is a youtube URL by reformatting it. + * + * @param string $url the url that should be fetched + * + * @return bool */ - public function canHandle($url): bool + public function canHandle(string $url): bool { return $this->buildUrl($url) !== $url; } |