* {"name"="username", "dataType"="string", "required"=true, "description"="username"}
* }
* )
+ *
* @return array
*/
public function getSaltAction($username)
* {"name"="tags", "dataType"="string", "required"=false, "format"="api%2Crest", "description"="a list of tags url encoded. Will returns entries that matches ALL tags."},
* }
* )
+ *
* @return Entry
*/
public function getEntriesAction(Request $request)
}
/**
- * Retrieve a single entry
+ * Retrieve a single entry.
*
* @ApiDoc(
* requirements={
* {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"}
* }
* )
+ *
* @return Entry
*/
public function getEntryAction(Entry $entry)
}
/**
- * Create an entry
+ * Create an entry.
*
* @ApiDoc(
* parameters={
* {"name"="tags", "dataType"="string", "required"=false, "format"="tag1,tag2,tag3", "description"="a comma-separated list of tags."},
* }
* )
+ *
* @return Entry
*/
public function postEntriesAction(Request $request)
}
/**
- * Change several properties of an entry
+ * Change several properties of an entry.
*
* @ApiDoc(
* requirements={
* {"name"="star", "dataType"="boolean", "required"=false, "format"="true or false", "description"="starred the entry."},
* }
* )
+ *
* @return Entry
*/
public function patchEntriesAction(Entry $entry, Request $request)
{
$this->validateUserAccess($entry->getUser()->getId(), $this->getUser()->getId());
- $title = $request->request->get("title");
- $isArchived = $request->request->get("archive");
- $isStarred = $request->request->get("star");
+ $title = $request->request->get('title');
+ $isArchived = $request->request->get('archive');
+ $isStarred = $request->request->get('star');
if (!is_null($title)) {
$entry->setTitle($title);
}
/**
- * Delete **permanently** an entry
+ * Delete **permanently** an entry.
*
* @ApiDoc(
* requirements={
* {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"}
* }
* )
+ *
* @return Entry
*/
public function deleteEntriesAction(Entry $entry)
}
/**
- * Retrieve all tags for an entry
+ * Retrieve all tags for an entry.
*
* @ApiDoc(
* requirements={
}
/**
- * Add one or more tags to an entry
+ * Add one or more tags to an entry.
*
* @ApiDoc(
* requirements={
}
/**
- * Permanently remove one tag for an entry
+ * Permanently remove one tag for an entry.
*
* @ApiDoc(
* requirements={
}
/**
- * Retrieve all tags
+ * Retrieve all tags.
*
* @ApiDoc()
*/
}
/**
- * Permanently remove one tag from **every** entry
+ * Permanently remove one tag from **every** entry.
*
* @ApiDoc(
* requirements={
/**
* Validate that the first id is equal to the second one.
- * If not, throw exception. It means a user try to access information from an other user
+ * If not, throw exception. It means a user try to access information from an other user.
*
- * @param integer $requestUserId User id from the requested source
- * @param integer $currentUserId User id from the retrieved source
+ * @param int $requestUserId User id from the requested source
+ * @param int $currentUserId User id from the retrieved source
*/
private function validateUserAccess($requestUserId, $currentUserId)
{
/**
* Send a JSON Response.
- * We don't use the Symfony JsonRespone, because it takes an array as parameter instead of a JSON string
+ * We don't use the Symfony JsonRespone, because it takes an array as parameter instead of a JSON string.
*
* @param string $json
*
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
- * This is the class that validates and merges configuration from your app/config files
+ * This is the class that validates and merges configuration from your app/config files.
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
*/
<?php
+
namespace Wallabag\ApiBundle\Security\Authentication\Provider;
use Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface;
$user = $this->userProvider->loadUserByUsername($token->getUsername());
if (!$user) {
- throw new AuthenticationException("Bad credentials. Did you forgot your username?");
+ throw new AuthenticationException('Bad credentials. Did you forgot your username?');
}
if ($user && $this->validateDigest($token->digest, $token->nonce, $token->created, $user->getPassword())) {
{
// Check created time is not in the future
if (strtotime($created) > time()) {
- throw new AuthenticationException("Back to the future...");
+ throw new AuthenticationException('Back to the future...');
}
// Expire timestamp after 5 minutes
if (time() - strtotime($created) > 300) {
- throw new AuthenticationException("Too late for this timestamp... Watch your watch.");
+ throw new AuthenticationException('Too late for this timestamp... Watch your watch.');
}
// Validate nonce is unique within 5 minutes
$expected = base64_encode(sha1(base64_decode($nonce).$created.$secret, true));
if ($digest !== $expected) {
- throw new AuthenticationException("Bad credentials ! Digest is not as expected.");
+ throw new AuthenticationException('Bad credentials ! Digest is not as expected.');
}
return $digest === $expected;
<?php
+
namespace Wallabag\ApiBundle\Security\Authentication\Token;
use Symfony\Component\Security\Core\Authentication\Token\AbstractToken;
protected static $salt;
/**
- * Grab the salt once and store it to be available for all tests
+ * Grab the salt once and store it to be available for all tests.
*/
public static function setUpBeforeClass()
{
}
/**
- * Generate HTTP headers for authenticate user on API
+ * Generate HTTP headers for authenticate user on API.
*
* @param string $username
* @param string $password
$content = json_decode($client->getResponse()->getContent(), true);
$this->assertArrayHasKey('tags', $content);
- $this->assertEquals($nbTags+3, count($content['tags']));
+ $this->assertEquals($nbTags + 3, count($content['tags']));
$entryDB = $client->getContainer()
->get('doctrine.orm.entity_manager')
$content = json_decode($client->getResponse()->getContent(), true);
$this->assertArrayHasKey('tags', $content);
- $this->assertEquals($nbTags-1, count($content['tags']));
+ $this->assertEquals($nbTags - 1, count($content['tags']));
}
public function testGetUserTags()
}
/**
- * Run a command
+ * Run a command.
*
* @param string $command
* @param array $parameters Parameters to this command (usually 'force' => true)
}
/**
- * Check if the database already exists
+ * Check if the database already exists.
*
- * @return boolean
+ * @return bool
*/
private function isDatabasePresent()
{
/**
* Check if the schema is already created.
- * If we found at least oen table, it means the schema exists
+ * If we found at least oen table, it means the schema exists.
*
- * @return boolean
+ * @return bool
*/
private function isSchemaPresent()
{
}
/**
- * Shows unread entries for current user
+ * Shows unread entries for current user.
*
* @Route("/unread", name="unread")
*
}
/**
- * Shows read entries for current user
+ * Shows read entries for current user.
*
* @Route("/archive", name="archive")
*
}
/**
- * Shows starred entries for current user
+ * Shows starred entries for current user.
*
* @Route("/starred", name="starred")
*
}
/**
- * Shows entry content
+ * Shows entry content.
*
* @param Entry $entry
*
}
/**
- * Changes read status for an entry
+ * Changes read status for an entry.
*
* @param Request $request
* @param Entry $entry
}
/**
- * Changes favorite status for an entry
+ * Changes favorite status for an entry.
*
* @param Request $request
* @param Entry $entry
}
/**
- * Deletes entry
+ * Deletes entry.
*
* @param Request $request
* @param Entry $entry
}
/**
- * Check if the logged user can manage the given entry
+ * Check if the logged user can manage the given entry.
*
* @param Entry $entry
*/
class RssController extends Controller
{
/**
- * Shows unread entries for current user
+ * Shows unread entries for current user.
*
* @Route("/{username}/{token}/unread.xml", name="unread_rss", defaults={"_format"="xml"})
* @ParamConverter("user", class="WallabagCoreBundle:User", converter="username_rsstoken_converter")
}
/**
- * Shows read entries for current user
+ * Shows read entries for current user.
*
* @Route("/{username}/{token}/archive.xml", name="archive_rss")
* @ParamConverter("user", class="WallabagCoreBundle:User", converter="username_rsstoken_converter")
}
/**
- * Shows starred entries for current user
+ * Shows starred entries for current user.
*
* @Route("/{username}/{token}/starred.xml", name="starred_rss")
* @ParamConverter("user", class="WallabagCoreBundle:User", converter="username_rsstoken_converter")
}
/**
- * Request forgot password: show form
+ * Request forgot password: show form.
*
* @Route("/forgot-password", name="forgot_password")
+ *
* @Method({"GET", "POST"})
*/
public function forgotPasswordAction(Request $request)
}
/**
- * Tell the user to check his email provider
+ * Tell the user to check his email provider.
*
* @Route("/forgot-password/check-email", name="forgot_password_check_email")
+ *
* @Method({"GET"})
*/
public function checkEmailAction(Request $request)
}
/**
- * Reset user password
+ * Reset user password.
*
* @Route("/forgot-password/{token}", name="forgot_password_reset")
+ *
* @Method({"GET", "POST"})
*/
public function resetAction(Request $request, $token)
$entry3->setContent('This is my content /o/');
$tag1 = new Tag($this->getReference('bob-user'));
- $tag1->setLabel("foo");
+ $tag1->setLabel('foo');
$tag2 = new Tag($this->getReference('bob-user'));
- $tag2->setLabel("bar");
+ $tag2->setLabel('bar');
$entry3->addTag($tag1);
$entry3->addTag($tag2);
$entry4->setContent('This is my content /o/');
$tag1 = new Tag($this->getReference('admin-user'));
- $tag1->setLabel("foo");
+ $tag1->setLabel('foo');
$tag2 = new Tag($this->getReference('admin-user'));
- $tag2->setLabel("bar");
+ $tag2->setLabel('bar');
$entry4->addTag($tag1);
$entry4->addTag($tag2);
*/
public function classToTableName($className)
{
- return strtolower($this->prefix . substr($className, strrpos($className, '\\') + 1));
+ return strtolower($this->prefix.substr($className, strrpos($className, '\\') + 1));
}
/**
*/
public function joinColumnName($propertyName)
{
- return $propertyName . '_' . $this->referenceColumnName();
+ return $propertyName.'_'.$this->referenceColumnName();
}
/**
// ie: not "wallabag_entry_wallabag_tag" but "wallabag_entry_tag"
$target = substr($targetEntity, strrpos($targetEntity, '\\') + 1);
- return strtolower($this->classToTableName($sourceEntity) . '_' .$target);
+ return strtolower($this->classToTableName($sourceEntity).'_'.$target);
}
/**
*/
public function joinKeyColumnName($entityName, $referencedColumnName = null)
{
- return strtolower($this->classToTableName($entityName) . '_' .($referencedColumnName ?: $this->referenceColumnName()));
+ return strtolower($this->classToTableName($entityName).'_'.($referencedColumnName ?: $this->referenceColumnName()));
}
/**
use Symfony\Component\Validator\Constraints as Assert;
/**
- * Config
+ * Config.
*
* @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\ConfigRepository")
* @ORM\Table
class Config
{
/**
- * @var integer
+ * @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
private $theme;
/**
- * @var integer
+ * @var int
*
* @Assert\NotBlank()
* @Assert\Range(
private $rssToken;
/**
- * @var integer
+ * @var int
*
* @ORM\Column(name="rss_limit", type="integer", nullable=true)
* @Assert\Range(
}
/**
- * Get id
+ * Get id.
*
- * @return integer
+ * @return int
*/
public function getId()
{
}
/**
- * Set theme
+ * Set theme.
+ *
+ * @param string $theme
*
- * @param string $theme
* @return Config
*/
public function setTheme($theme)
}
/**
- * Get theme
+ * Get theme.
*
* @return string
*/
}
/**
- * Set itemsPerPage
+ * Set itemsPerPage.
+ *
+ * @param int $itemsPerPage
*
- * @param integer $itemsPerPage
* @return Config
*/
public function setItemsPerPage($itemsPerPage)
}
/**
- * Get itemsPerPage
+ * Get itemsPerPage.
*
- * @return integer
+ * @return int
*/
public function getItemsPerPage()
{
}
/**
- * Set language
+ * Set language.
+ *
+ * @param string $language
*
- * @param string $language
* @return Config
*/
public function setLanguage($language)
}
/**
- * Get language
+ * Get language.
*
* @return string
*/
}
/**
- * Set user
+ * Set user.
+ *
+ * @param \Wallabag\CoreBundle\Entity\User $user
*
- * @param \Wallabag\CoreBundle\Entity\User $user
* @return Config
*/
public function setUser(\Wallabag\CoreBundle\Entity\User $user = null)
}
/**
- * Get user
+ * Get user.
*
* @return \Wallabag\CoreBundle\Entity\User
*/
}
/**
- * Set rssToken
+ * Set rssToken.
+ *
+ * @param string $rssToken
*
- * @param string $rssToken
* @return Config
*/
public function setRssToken($rssToken)
}
/**
- * Get rssToken
+ * Get rssToken.
*
* @return string
*/
}
/**
- * Set rssLimit
+ * Set rssLimit.
+ *
+ * @param string $rssLimit
*
- * @param string $rssLimit
* @return Config
*/
public function setRssLimit($rssLimit)
}
/**
- * Get rssLimit
+ * Get rssLimit.
*
* @return string
*/
use JMS\Serializer\Annotation\XmlRoot;
/**
- * Entry
+ * Entry.
*
* @XmlRoot("entry")
* @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\EntryRepository")
{
/** @Serializer\XmlAttribute */
/**
- * @var integer
+ * @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
private $url;
/**
- * @var boolean
+ * @var bool
*
* @ORM\Column(name="is_archived", type="boolean")
*/
private $isArchived = false;
/**
- * @var boolean
+ * @var bool
*
* @ORM\Column(name="is_starred", type="boolean")
*/
private $mimetype;
/**
- * @var integer
+ * @var int
*
* @ORM\Column(name="reading_type", type="integer", nullable=true)
*/
private $domainName;
/**
- * @var boolean
+ * @var bool
*
* @ORM\Column(name="is_public", type="boolean", nullable=true, options={"default" = false})
*/
}
/**
- * Get id
+ * Get id.
*
- * @return integer
+ * @return int
*/
public function getId()
{
}
/**
- * Set title
+ * Set title.
+ *
+ * @param string $title
*
- * @param string $title
* @return Entry
*/
public function setTitle($title)
}
/**
- * Get title
+ * Get title.
*
* @return string
*/
}
/**
- * Set url
+ * Set url.
+ *
+ * @param string $url
*
- * @param string $url
* @return Entry
*/
public function setUrl($url)
}
/**
- * Get url
+ * Get url.
*
* @return string
*/
}
/**
- * Set isArchived
+ * Set isArchived.
+ *
+ * @param string $isArchived
*
- * @param string $isArchived
* @return Entry
*/
public function setArchived($isArchived)
}
/**
- * Get isArchived
+ * Get isArchived.
*
* @return string
*/
}
/**
- * Set isStarred
+ * Set isStarred.
+ *
+ * @param string $isStarred
*
- * @param string $isStarred
* @return Entry
*/
public function setStarred($isStarred)
}
/**
- * Get isStarred
+ * Get isStarred.
*
* @return string
*/
}
/**
- * Set content
+ * Set content.
+ *
+ * @param string $content
*
- * @param string $content
* @return Entry
*/
public function setContent($content)
}
/**
- * Get content
+ * Get content.
*
* @return string
*/
}
/**
- * @return boolean
+ * @return bool
*/
public function isPublic()
{
}
/**
- * @param boolean $isPublic
+ * @param bool $isPublic
*/
public function setPublic($isPublic)
{
use Doctrine\Common\Collections\ArrayCollection;
/**
- * Tag
+ * Tag.
*
* @XmlRoot("tag")
* @ORM\Table
class Tag
{
/**
- * @var integer
+ * @var int
*
* @Expose
* @ORM\Column(name="id", type="integer")
$this->entries = new ArrayCollection();
}
/**
- * Get id
+ * Get id.
*
- * @return integer
+ * @return int
*/
public function getId()
{
}
/**
- * Set label
+ * Set label.
+ *
+ * @param string $label
*
- * @param string $label
* @return Tag
*/
public function setLabel($label)
}
/**
- * Get label
+ * Get label.
*
* @return string
*/
use JMS\Serializer\Annotation\Expose;
/**
- * User
+ * User.
*
* @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\UserRepository")
* @ORM\Table
class User implements AdvancedUserInterface, \Serializable
{
/**
- * @var integer
+ * @var int
*
* @Expose
* @ORM\Column(name="id", type="integer")
}
/**
- * Get id
+ * Get id.
*
- * @return integer
+ * @return int
*/
public function getId()
{
}
/**
- * Set username
+ * Set username.
+ *
+ * @param string $username
*
- * @param string $username
* @return User
*/
public function setUsername($username)
}
/**
- * Get username
+ * Get username.
*
* @return string
*/
}
/**
- * Set password
+ * Set password.
+ *
+ * @param string $password
*
- * @param string $password
* @return User
*/
public function setPassword($password)
}
/**
- * Get password
+ * Get password.
*
* @return string
*/
}
/**
- * Set name
+ * Set name.
+ *
+ * @param string $name
*
- * @param string $name
* @return User
*/
public function setName($name)
}
/**
- * Get name
+ * Get name.
*
* @return string
*/
}
/**
- * Set email
+ * Set email.
+ *
+ * @param string $email
*
- * @param string $email
* @return User
*/
public function setEmail($email)
}
/**
- * Get email
+ * Get email.
*
* @return string
*/
public function unserialize($serialized)
{
list(
- $this->id,
- ) = unserialize($serialized);
+ $this->id) = unserialize($serialized);
}
public function isEqualTo(UserInterface $user)
return $this->isActive;
}
/**
- * Set config
+ * Set config.
+ *
+ * @param \Wallabag\CoreBundle\Entity\Config $config
*
- * @param \Wallabag\CoreBundle\Entity\Config $config
* @return User
*/
public function setConfig(\Wallabag\CoreBundle\Entity\Config $config = null)
}
/**
- * Get config
+ * Get config.
*
* @return \Wallabag\CoreBundle\Entity\Config
*/
}
/**
- * Set confirmationToken
+ * Set confirmationToken.
+ *
+ * @param string $confirmationToken
*
- * @param string $confirmationToken
* @return User
*/
public function setConfirmationToken($confirmationToken)
}
/**
- * Get confirmationToken
+ * Get confirmationToken.
*
* @return string
*/
}
/**
- * Set passwordRequestedAt
+ * Set passwordRequestedAt.
+ *
+ * @param \DateTime $passwordRequestedAt
*
- * @param \DateTime $passwordRequestedAt
* @return User
*/
public function setPasswordRequestedAt($passwordRequestedAt)
}
/**
- * Get passwordRequestedAt
+ * Get passwordRequestedAt.
*
* @return \DateTime
*/
<?php
+
namespace Wallabag\CoreBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
<?php
+
namespace Wallabag\CoreBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
<?php
+
namespace Wallabag\CoreBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
<?php
+
namespace Wallabag\CoreBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
<?php
+
namespace Wallabag\CoreBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
<?php
+
namespace Wallabag\CoreBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
<?php
+
namespace Wallabag\CoreBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
<?php
+
namespace Wallabag\CoreBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
final class Tools
{
/**
- * Download a file (typically, for downloading pictures on web server)
+ * Download a file (typically, for downloading pictures on web server).
*
* @param $url
+ *
* @return bool|mixed|string
*/
public static function getFile($url)
{
$timeout = 15;
- $useragent = "Mozilla/5.0 (Windows NT 5.1; rv:18.0) Gecko/20100101 Firefox/18.0";
+ $useragent = 'Mozilla/5.0 (Windows NT 5.1; rv:18.0) Gecko/20100101 Firefox/18.0';
if (in_array('curl', get_loaded_extensions())) {
# Fetch feed from URL
# FeedBurner requires a proper USER-AGENT...
curl_setopt($curl, CURL_HTTP_VERSION_1_1, true);
- curl_setopt($curl, CURLOPT_ENCODING, "gzip, deflate");
+ curl_setopt($curl, CURLOPT_ENCODING, 'gzip, deflate');
curl_setopt($curl, CURLOPT_USERAGENT, $useragent);
$data = curl_exec($curl);
array(
'http' => array(
'timeout' => $timeout,
- 'header' => "User-Agent: ".$useragent,
+ 'header' => 'User-Agent: '.$useragent,
'follow_location' => true,
),
'ssl' => array(
}
/**
- * Encode a URL by using a salt
+ * Encode a URL by using a salt.
*
* @param $string
+ *
* @return string
*/
public static function encodeString($string)
class EntryRepository extends EntityRepository
{
/**
- * Retrieves unread entries for a user
+ * Retrieves unread entries for a user.
*
* @param int $userId
* @param int $firstResult
}
/**
- * Retrieves read entries for a user
+ * Retrieves read entries for a user.
*
* @param int $userId
* @param int $firstResult
}
/**
- * Retrieves starred entries for a user
+ * Retrieves starred entries for a user.
*
* @param int $userId
* @param int $firstResult
}
/**
- * Find Entries
+ * Find Entries.
*
* @param int $userId
* @param bool $isArchived
class UserRepository extends EntityRepository
{
/**
- * Find a user by its username and rss roken
+ * Find a user by its username and rss roken.
*
* @param string $username
* @param string $rssToken
/**
* This override just add en extra variable (username) to be able to salt the password
- * the way Wallabag v1 does. It will avoid to break compatibility with Wallabag v1
- *
+ * the way Wallabag v1 does. It will avoid to break compatibility with Wallabag v1.
*/
class WallabagPasswordEncoder extends BasePasswordEncoder
{
throw new BadCredentialsException('The credentials were changed from another session.');
}
} else {
- if ("" === ($presentedPassword = $token->getCredentials())) {
+ if ('' === ($presentedPassword = $token->getCredentials())) {
throw new BadCredentialsException('The presented password cannot be empty.');
}
{
public static function extract($url)
{
- $pageContent = Extractor::getPageContent(new Url(base64_encode($url)));
+ $pageContent = self::getPageContent(new Url(base64_encode($url)));
$title = $pageContent['rss']['channel']['item']['title'] ?: 'Untitled';
$body = $pageContent['rss']['channel']['item']['description'];
}
/**
- * Get the content for a given URL (by a call to FullTextFeed)
+ * Get the content for a given URL (by a call to FullTextFeed).
+ *
+ * @param Url $url
*
- * @param Url $url
* @return mixed
*/
public static function getPageContent(Url $url)
$scope = function () {
extract(func_get_arg(1));
$_GET = $_REQUEST = array(
- "url" => $url->getUrl(),
- "max" => 5,
- "links" => "preserve",
- "exc" => "",
- "format" => "json",
- "submit" => "Create Feed",
+ 'url' => $url->getUrl(),
+ 'max' => 5,
+ 'links' => 'preserve',
+ 'exc' => '',
+ 'format' => 'json',
+ 'submit' => 'Create Feed',
);
ob_start();
require func_get_arg(0);
// Silence $scope function to avoid
// issues with FTRSS when error_reporting is to high
// FTRSS generates PHP warnings which break output
- $json = @$scope(__DIR__."/../../../../vendor/wallabag/Fivefilters_Libraries/makefulltextfeed.php", array("url" => $url));
+ $json = @$scope(__DIR__.'/../../../../vendor/wallabag/Fivefilters_Libraries/makefulltextfeed.php', array('url' => $url));
// Clearing and restoring context
foreach ($GLOBALS as $key => $value) {
- if ($key != "GLOBALS" && $key != "_SESSION") {
+ if ($key != 'GLOBALS' && $key != '_SESSION') {
unset($GLOBALS[$key]);
}
}
class Utils
{
/**
- * Generate a token used for RSS
+ * Generate a token used for RSS.
*
* @return string
*/
}
/**
- * Returns the domain name for a URL
+ * Returns the domain name for a URL.
*
* @param $url
+ *
* @return string
*/
public static function getDomainName($url)
}
/**
- * For a given text, we calculate reading time for an article
+ * For a given text, we calculate reading time for an article.
*
* @param $text
+ *
* @return float
*/
public static function getReadingTime($text)