diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@smile.fr> | 2015-10-20 13:58:13 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-01-02 23:24:17 +0100 |
commit | 1f4408de9ed08f3b0fda45a93f1585c80feeb21d (patch) | |
tree | c8e7e05e9db85b331dde2ba5fef35796d8f3439f /src/Wallabag/CoreBundle | |
parent | 10b40f85d664da2b3ebcfd24d6e7145c9cd90d64 (diff) | |
download | wallabag-1f4408de9ed08f3b0fda45a93f1585c80feeb21d.tar.gz wallabag-1f4408de9ed08f3b0fda45a93f1585c80feeb21d.tar.zst wallabag-1f4408de9ed08f3b0fda45a93f1585c80feeb21d.zip |
1st draft for Pocket import via API
Diffstat (limited to 'src/Wallabag/CoreBundle')
-rw-r--r-- | src/Wallabag/CoreBundle/Tools/Utils.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Tools/Utils.php b/src/Wallabag/CoreBundle/Tools/Utils.php index a16baca9..b146d98b 100644 --- a/src/Wallabag/CoreBundle/Tools/Utils.php +++ b/src/Wallabag/CoreBundle/Tools/Utils.php | |||
@@ -27,6 +27,15 @@ class Utils | |||
27 | } | 27 | } |
28 | 28 | ||
29 | /** | 29 | /** |
30 | * @param $words | ||
31 | * @return float | ||
32 | */ | ||
33 | public static function convertWordsToMinutes($words) | ||
34 | { | ||
35 | return floor($words / 200); | ||
36 | } | ||
37 | |||
38 | /** | ||
30 | * For a given text, we calculate reading time for an article | 39 | * For a given text, we calculate reading time for an article |
31 | * based on 200 words per minute. | 40 | * based on 200 words per minute. |
32 | * | 41 | * |
@@ -36,6 +45,6 @@ class Utils | |||
36 | */ | 45 | */ |
37 | public static function getReadingTime($text) | 46 | public static function getReadingTime($text) |
38 | { | 47 | { |
39 | return floor(str_word_count(strip_tags($text)) / 200); | 48 | return self::convertWordsToMinutes(str_word_count(strip_tags($text))); |
40 | } | 49 | } |
41 | } | 50 | } |