]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Twig/Extension/WallabagExtension.php
Merge pull request #1297 from wallabag/v2-estimated-time
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Twig / Extension / WallabagExtension.php
index 92406865fc2ac682f77b1a0e88e440843b11695e..5f0a9643436b71c5ca51ff7c2147beb30df6ba09 100644 (file)
@@ -7,15 +7,15 @@ class WallabagExtension extends \Twig_Extension
     public function getFilters()
     {
         return array(
-            new \Twig_SimpleFilter('readingTime', array($this, 'getReadingTime')),
             new \Twig_SimpleFilter('domainName', array($this, 'getDomainName')),
         );
     }
 
     /**
-     * Returns the domain name for a URL
+     * Returns the domain name for a URL.
      *
      * @param $url
+     *
      * @return string
      */
     public static function getDomainName($url)
@@ -23,17 +23,6 @@ class WallabagExtension extends \Twig_Extension
         return parse_url($url, PHP_URL_HOST);
     }
 
-    /**
-     * For a given text, we calculate reading time for an article
-     *
-     * @param $text
-     * @return float
-     */
-    public static function getReadingTime($text)
-    {
-        return floor(str_word_count(strip_tags($text)) / 200);
-    }
-
     public function getName()
     {
         return 'wallabag_extension';