summaryrefslogtreecommitdiffstats
path: root/lib/Fetcher
diff options
context:
space:
mode:
authorSean Molenaar <sean@seanmolenaar.eu>2020-08-29 23:39:35 +0200
committerBenjamin Brahmer <info@b-brahmer.de>2020-09-27 15:35:31 +0200
commitd00d1ab2a28f428223e52b17052c072c64784016 (patch)
treec019f85fb7ac67147dd43ca64b4ac3cda99832f7 /lib/Fetcher
parent5687baca75d47dbdffd3de74e865ad2f71ef0cb7 (diff)
Create V2 mapper, Service and management commands
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
Diffstat (limited to 'lib/Fetcher')
-rwxr-xr-xlib/Fetcher/FeedFetcher.php2
-rw-r--r--lib/Fetcher/IFeedFetcher.php2
-rw-r--r--lib/Fetcher/YoutubeFetcher.php8
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;
}