From 4346a86068781f4acdeb574d7e2af08b77b58ea7 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 30 May 2015 13:52:26 +0200 Subject: CS --- src/Wallabag/CoreBundle/Command/InstallCommand.php | 10 ++-- .../CoreBundle/Controller/EntryController.php | 16 +++--- .../CoreBundle/Controller/RssController.php | 6 +-- .../CoreBundle/Controller/SecurityController.php | 9 ++-- .../CoreBundle/DataFixtures/ORM/LoadEntryData.php | 8 +-- .../Doctrine/Mapping/PrefixedNamingStrategy.php | 8 +-- src/Wallabag/CoreBundle/Entity/Config.php | 56 +++++++++++--------- src/Wallabag/CoreBundle/Entity/Entry.php | 55 +++++++++++--------- src/Wallabag/CoreBundle/Entity/Tag.php | 15 +++--- src/Wallabag/CoreBundle/Entity/User.php | 60 ++++++++++++---------- .../CoreBundle/Form/Type/ChangePasswordType.php | 1 + src/Wallabag/CoreBundle/Form/Type/ConfigType.php | 1 + src/Wallabag/CoreBundle/Form/Type/EntryType.php | 1 + .../CoreBundle/Form/Type/ForgotPasswordType.php | 1 + src/Wallabag/CoreBundle/Form/Type/NewUserType.php | 1 + .../CoreBundle/Form/Type/ResetPasswordType.php | 1 + src/Wallabag/CoreBundle/Form/Type/RssType.php | 1 + .../CoreBundle/Form/Type/UserInformationType.php | 1 + src/Wallabag/CoreBundle/Helper/Tools.php | 12 +++-- .../CoreBundle/Repository/EntryRepository.php | 8 +-- .../CoreBundle/Repository/UserRepository.php | 2 +- .../Encoder/WallabagPasswordEncoder.php | 3 +- .../Provider/WallabagAuthenticationProvider.php | 2 +- src/Wallabag/CoreBundle/Service/Extractor.php | 23 +++++---- src/Wallabag/CoreBundle/Tools/Utils.php | 2 +- .../Twig/Extension/WallabagExtension.php | 6 ++- 26 files changed, 171 insertions(+), 138 deletions(-) (limited to 'src/Wallabag/CoreBundle') diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 493842f7..491c67f9 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -225,7 +225,7 @@ class InstallCommand extends ContainerAwareCommand } /** - * Run a command + * Run a command. * * @param string $command * @param array $parameters Parameters to this command (usually 'force' => true) @@ -266,9 +266,9 @@ class InstallCommand extends ContainerAwareCommand } /** - * Check if the database already exists + * Check if the database already exists. * - * @return boolean + * @return bool */ private function isDatabasePresent() { @@ -300,9 +300,9 @@ class InstallCommand extends ContainerAwareCommand /** * 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() { diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 8a8f3cd7..7fd982c9 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -50,7 +50,7 @@ class EntryController extends Controller } /** - * Shows unread entries for current user + * Shows unread entries for current user. * * @Route("/unread", name="unread") * @@ -70,7 +70,7 @@ class EntryController extends Controller } /** - * Shows read entries for current user + * Shows read entries for current user. * * @Route("/archive", name="archive") * @@ -90,7 +90,7 @@ class EntryController extends Controller } /** - * Shows starred entries for current user + * Shows starred entries for current user. * * @Route("/starred", name="starred") * @@ -110,7 +110,7 @@ class EntryController extends Controller } /** - * Shows entry content + * Shows entry content. * * @param Entry $entry * @@ -129,7 +129,7 @@ class EntryController extends Controller } /** - * Changes read status for an entry + * Changes read status for an entry. * * @param Request $request * @param Entry $entry @@ -154,7 +154,7 @@ class EntryController extends Controller } /** - * Changes favorite status for an entry + * Changes favorite status for an entry. * * @param Request $request * @param Entry $entry @@ -179,7 +179,7 @@ class EntryController extends Controller } /** - * Deletes entry + * Deletes entry. * * @param Request $request * @param Entry $entry @@ -205,7 +205,7 @@ class EntryController extends Controller } /** - * Check if the logged user can manage the given entry + * Check if the logged user can manage the given entry. * * @param Entry $entry */ diff --git a/src/Wallabag/CoreBundle/Controller/RssController.php b/src/Wallabag/CoreBundle/Controller/RssController.php index 14f1dcb2..86754e15 100644 --- a/src/Wallabag/CoreBundle/Controller/RssController.php +++ b/src/Wallabag/CoreBundle/Controller/RssController.php @@ -11,7 +11,7 @@ use Wallabag\CoreBundle\Entity\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") @@ -35,7 +35,7 @@ class RssController extends Controller } /** - * 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") @@ -59,7 +59,7 @@ class RssController extends Controller } /** - * 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") diff --git a/src/Wallabag/CoreBundle/Controller/SecurityController.php b/src/Wallabag/CoreBundle/Controller/SecurityController.php index fe511db5..a61a898b 100644 --- a/src/Wallabag/CoreBundle/Controller/SecurityController.php +++ b/src/Wallabag/CoreBundle/Controller/SecurityController.php @@ -30,9 +30,10 @@ class SecurityController extends Controller } /** - * Request forgot password: show form + * Request forgot password: show form. * * @Route("/forgot-password", name="forgot_password") + * * @Method({"GET", "POST"}) */ public function forgotPasswordAction(Request $request) @@ -73,9 +74,10 @@ class SecurityController extends Controller } /** - * 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) @@ -93,9 +95,10 @@ class SecurityController extends Controller } /** - * Reset user password + * Reset user password. * * @Route("/forgot-password/{token}", name="forgot_password_reset") + * * @Method({"GET", "POST"}) */ public function resetAction(Request $request, $token) diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php index 54d0d6b6..547d6753 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php @@ -39,9 +39,9 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface $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); @@ -56,9 +56,9 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface $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); diff --git a/src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php b/src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php index 724812fd..509348db 100644 --- a/src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php +++ b/src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php @@ -25,7 +25,7 @@ class PrefixedNamingStrategy implements NamingStrategy */ public function classToTableName($className) { - return strtolower($this->prefix . substr($className, strrpos($className, '\\') + 1)); + return strtolower($this->prefix.substr($className, strrpos($className, '\\') + 1)); } /** @@ -49,7 +49,7 @@ class PrefixedNamingStrategy implements NamingStrategy */ public function joinColumnName($propertyName) { - return $propertyName . '_' . $this->referenceColumnName(); + return $propertyName.'_'.$this->referenceColumnName(); } /** @@ -62,7 +62,7 @@ class PrefixedNamingStrategy implements NamingStrategy // 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); } /** @@ -70,7 +70,7 @@ class PrefixedNamingStrategy implements NamingStrategy */ public function joinKeyColumnName($entityName, $referencedColumnName = null) { - return strtolower($this->classToTableName($entityName) . '_' .($referencedColumnName ?: $this->referenceColumnName())); + return strtolower($this->classToTableName($entityName).'_'.($referencedColumnName ?: $this->referenceColumnName())); } /** diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php index 62ea637e..025d94ef 100644 --- a/src/Wallabag/CoreBundle/Entity/Config.php +++ b/src/Wallabag/CoreBundle/Entity/Config.php @@ -6,7 +6,7 @@ use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; /** - * Config + * Config. * * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\ConfigRepository") * @ORM\Table @@ -15,7 +15,7 @@ use Symfony\Component\Validator\Constraints as Assert; class Config { /** - * @var integer + * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id @@ -32,7 +32,7 @@ class Config private $theme; /** - * @var integer + * @var int * * @Assert\NotBlank() * @Assert\Range( @@ -60,7 +60,7 @@ class Config private $rssToken; /** - * @var integer + * @var int * * @ORM\Column(name="rss_limit", type="integer", nullable=true) * @Assert\Range( @@ -85,9 +85,9 @@ class Config } /** - * Get id + * Get id. * - * @return integer + * @return int */ public function getId() { @@ -95,9 +95,10 @@ class Config } /** - * Set theme + * Set theme. + * + * @param string $theme * - * @param string $theme * @return Config */ public function setTheme($theme) @@ -108,7 +109,7 @@ class Config } /** - * Get theme + * Get theme. * * @return string */ @@ -118,9 +119,10 @@ class Config } /** - * Set itemsPerPage + * Set itemsPerPage. + * + * @param int $itemsPerPage * - * @param integer $itemsPerPage * @return Config */ public function setItemsPerPage($itemsPerPage) @@ -131,9 +133,9 @@ class Config } /** - * Get itemsPerPage + * Get itemsPerPage. * - * @return integer + * @return int */ public function getItemsPerPage() { @@ -141,9 +143,10 @@ class Config } /** - * Set language + * Set language. + * + * @param string $language * - * @param string $language * @return Config */ public function setLanguage($language) @@ -154,7 +157,7 @@ class Config } /** - * Get language + * Get language. * * @return string */ @@ -164,9 +167,10 @@ class Config } /** - * 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) @@ -177,7 +181,7 @@ class Config } /** - * Get user + * Get user. * * @return \Wallabag\CoreBundle\Entity\User */ @@ -187,9 +191,10 @@ class Config } /** - * Set rssToken + * Set rssToken. + * + * @param string $rssToken * - * @param string $rssToken * @return Config */ public function setRssToken($rssToken) @@ -200,7 +205,7 @@ class Config } /** - * Get rssToken + * Get rssToken. * * @return string */ @@ -210,9 +215,10 @@ class Config } /** - * Set rssLimit + * Set rssLimit. + * + * @param string $rssLimit * - * @param string $rssLimit * @return Config */ public function setRssLimit($rssLimit) @@ -223,7 +229,7 @@ class Config } /** - * Get rssLimit + * Get rssLimit. * * @return string */ diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 15af105d..b1998ab6 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -9,7 +9,7 @@ use Hateoas\Configuration\Annotation as Hateoas; use JMS\Serializer\Annotation\XmlRoot; /** - * Entry + * Entry. * * @XmlRoot("entry") * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\EntryRepository") @@ -21,7 +21,7 @@ class Entry { /** @Serializer\XmlAttribute */ /** - * @var integer + * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id @@ -45,14 +45,14 @@ class Entry 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") */ @@ -94,7 +94,7 @@ class Entry private $mimetype; /** - * @var integer + * @var int * * @ORM\Column(name="reading_type", type="integer", nullable=true) */ @@ -108,7 +108,7 @@ class Entry private $domainName; /** - * @var boolean + * @var bool * * @ORM\Column(name="is_public", type="boolean", nullable=true, options={"default" = false}) */ @@ -135,9 +135,9 @@ class Entry } /** - * Get id + * Get id. * - * @return integer + * @return int */ public function getId() { @@ -145,9 +145,10 @@ class Entry } /** - * Set title + * Set title. + * + * @param string $title * - * @param string $title * @return Entry */ public function setTitle($title) @@ -158,7 +159,7 @@ class Entry } /** - * Get title + * Get title. * * @return string */ @@ -168,9 +169,10 @@ class Entry } /** - * Set url + * Set url. + * + * @param string $url * - * @param string $url * @return Entry */ public function setUrl($url) @@ -181,7 +183,7 @@ class Entry } /** - * Get url + * Get url. * * @return string */ @@ -191,9 +193,10 @@ class Entry } /** - * Set isArchived + * Set isArchived. + * + * @param string $isArchived * - * @param string $isArchived * @return Entry */ public function setArchived($isArchived) @@ -204,7 +207,7 @@ class Entry } /** - * Get isArchived + * Get isArchived. * * @return string */ @@ -221,9 +224,10 @@ class Entry } /** - * Set isStarred + * Set isStarred. + * + * @param string $isStarred * - * @param string $isStarred * @return Entry */ public function setStarred($isStarred) @@ -234,7 +238,7 @@ class Entry } /** - * Get isStarred + * Get isStarred. * * @return string */ @@ -251,9 +255,10 @@ class Entry } /** - * Set content + * Set content. + * + * @param string $content * - * @param string $content * @return Entry */ public function setContent($content) @@ -264,7 +269,7 @@ class Entry } /** - * Get content + * Get content. * * @return string */ @@ -375,7 +380,7 @@ class Entry } /** - * @return boolean + * @return bool */ public function isPublic() { @@ -383,7 +388,7 @@ class Entry } /** - * @param boolean $isPublic + * @param bool $isPublic */ public function setPublic($isPublic) { diff --git a/src/Wallabag/CoreBundle/Entity/Tag.php b/src/Wallabag/CoreBundle/Entity/Tag.php index 9d3c7a32..afe9e1b9 100644 --- a/src/Wallabag/CoreBundle/Entity/Tag.php +++ b/src/Wallabag/CoreBundle/Entity/Tag.php @@ -9,7 +9,7 @@ use JMS\Serializer\Annotation\Expose; use Doctrine\Common\Collections\ArrayCollection; /** - * Tag + * Tag. * * @XmlRoot("tag") * @ORM\Table @@ -19,7 +19,7 @@ use Doctrine\Common\Collections\ArrayCollection; class Tag { /** - * @var integer + * @var int * * @Expose * @ORM\Column(name="id", type="integer") @@ -52,9 +52,9 @@ class Tag $this->entries = new ArrayCollection(); } /** - * Get id + * Get id. * - * @return integer + * @return int */ public function getId() { @@ -62,9 +62,10 @@ class Tag } /** - * Set label + * Set label. + * + * @param string $label * - * @param string $label * @return Tag */ public function setLabel($label) @@ -75,7 +76,7 @@ class Tag } /** - * Get label + * Get label. * * @return string */ diff --git a/src/Wallabag/CoreBundle/Entity/User.php b/src/Wallabag/CoreBundle/Entity/User.php index ff08c8fb..00eb808a 100644 --- a/src/Wallabag/CoreBundle/Entity/User.php +++ b/src/Wallabag/CoreBundle/Entity/User.php @@ -12,7 +12,7 @@ use JMS\Serializer\Annotation\ExclusionPolicy; use JMS\Serializer\Annotation\Expose; /** - * User + * User. * * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\UserRepository") * @ORM\Table @@ -25,7 +25,7 @@ use JMS\Serializer\Annotation\Expose; class User implements AdvancedUserInterface, \Serializable { /** - * @var integer + * @var int * * @Expose * @ORM\Column(name="id", type="integer") @@ -142,9 +142,9 @@ class User implements AdvancedUserInterface, \Serializable } /** - * Get id + * Get id. * - * @return integer + * @return int */ public function getId() { @@ -152,9 +152,10 @@ class User implements AdvancedUserInterface, \Serializable } /** - * Set username + * Set username. + * + * @param string $username * - * @param string $username * @return User */ public function setUsername($username) @@ -165,7 +166,7 @@ class User implements AdvancedUserInterface, \Serializable } /** - * Get username + * Get username. * * @return string */ @@ -191,9 +192,10 @@ class User implements AdvancedUserInterface, \Serializable } /** - * Set password + * Set password. + * + * @param string $password * - * @param string $password * @return User */ public function setPassword($password) @@ -208,7 +210,7 @@ class User implements AdvancedUserInterface, \Serializable } /** - * Get password + * Get password. * * @return string */ @@ -218,9 +220,10 @@ class User implements AdvancedUserInterface, \Serializable } /** - * Set name + * Set name. + * + * @param string $name * - * @param string $name * @return User */ public function setName($name) @@ -231,7 +234,7 @@ class User implements AdvancedUserInterface, \Serializable } /** - * Get name + * Get name. * * @return string */ @@ -241,9 +244,10 @@ class User implements AdvancedUserInterface, \Serializable } /** - * Set email + * Set email. + * + * @param string $email * - * @param string $email * @return User */ public function setEmail($email) @@ -254,7 +258,7 @@ class User implements AdvancedUserInterface, \Serializable } /** - * Get email + * Get email. * * @return string */ @@ -341,8 +345,7 @@ class User implements AdvancedUserInterface, \Serializable public function unserialize($serialized) { list( - $this->id, - ) = unserialize($serialized); + $this->id) = unserialize($serialized); } public function isEqualTo(UserInterface $user) @@ -370,9 +373,10 @@ class User implements AdvancedUserInterface, \Serializable 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) @@ -383,7 +387,7 @@ class User implements AdvancedUserInterface, \Serializable } /** - * Get config + * Get config. * * @return \Wallabag\CoreBundle\Entity\Config */ @@ -393,9 +397,10 @@ class User implements AdvancedUserInterface, \Serializable } /** - * Set confirmationToken + * Set confirmationToken. + * + * @param string $confirmationToken * - * @param string $confirmationToken * @return User */ public function setConfirmationToken($confirmationToken) @@ -406,7 +411,7 @@ class User implements AdvancedUserInterface, \Serializable } /** - * Get confirmationToken + * Get confirmationToken. * * @return string */ @@ -416,9 +421,10 @@ class User implements AdvancedUserInterface, \Serializable } /** - * Set passwordRequestedAt + * Set passwordRequestedAt. + * + * @param \DateTime $passwordRequestedAt * - * @param \DateTime $passwordRequestedAt * @return User */ public function setPasswordRequestedAt($passwordRequestedAt) @@ -429,7 +435,7 @@ class User implements AdvancedUserInterface, \Serializable } /** - * Get passwordRequestedAt + * Get passwordRequestedAt. * * @return \DateTime */ diff --git a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php index e141789f..b4224e3d 100644 --- a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php +++ b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php @@ -1,4 +1,5 @@ array( 'timeout' => $timeout, - 'header' => "User-Agent: ".$useragent, + 'header' => 'User-Agent: '.$useragent, 'follow_location' => true, ), 'ssl' => array( @@ -91,9 +92,10 @@ final class Tools } /** - * Encode a URL by using a salt + * Encode a URL by using a salt. * * @param $string + * * @return string */ public static function encodeString($string) diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index a8c138a9..1335e808 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -10,7 +10,7 @@ use Pagerfanta\Pagerfanta; class EntryRepository extends EntityRepository { /** - * Retrieves unread entries for a user + * Retrieves unread entries for a user. * * @param int $userId * @param int $firstResult @@ -35,7 +35,7 @@ class EntryRepository extends EntityRepository } /** - * Retrieves read entries for a user + * Retrieves read entries for a user. * * @param int $userId * @param int $firstResult @@ -61,7 +61,7 @@ class EntryRepository extends EntityRepository } /** - * Retrieves starred entries for a user + * Retrieves starred entries for a user. * * @param int $userId * @param int $firstResult @@ -87,7 +87,7 @@ class EntryRepository extends EntityRepository } /** - * Find Entries + * Find Entries. * * @param int $userId * @param bool $isArchived diff --git a/src/Wallabag/CoreBundle/Repository/UserRepository.php b/src/Wallabag/CoreBundle/Repository/UserRepository.php index aab3dedc..968d0b49 100644 --- a/src/Wallabag/CoreBundle/Repository/UserRepository.php +++ b/src/Wallabag/CoreBundle/Repository/UserRepository.php @@ -7,7 +7,7 @@ use Doctrine\ORM\EntityRepository; 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 diff --git a/src/Wallabag/CoreBundle/Security/Authentication/Encoder/WallabagPasswordEncoder.php b/src/Wallabag/CoreBundle/Security/Authentication/Encoder/WallabagPasswordEncoder.php index fcfe418b..e7c81fc0 100644 --- a/src/Wallabag/CoreBundle/Security/Authentication/Encoder/WallabagPasswordEncoder.php +++ b/src/Wallabag/CoreBundle/Security/Authentication/Encoder/WallabagPasswordEncoder.php @@ -7,8 +7,7 @@ use Symfony\Component\Security\Core\Exception\BadCredentialsException; /** * 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 { diff --git a/src/Wallabag/CoreBundle/Security/Authentication/Provider/WallabagAuthenticationProvider.php b/src/Wallabag/CoreBundle/Security/Authentication/Provider/WallabagAuthenticationProvider.php index 1c7c5fae..cf3cb051 100644 --- a/src/Wallabag/CoreBundle/Security/Authentication/Provider/WallabagAuthenticationProvider.php +++ b/src/Wallabag/CoreBundle/Security/Authentication/Provider/WallabagAuthenticationProvider.php @@ -45,7 +45,7 @@ class WallabagAuthenticationProvider extends UserAuthenticationProvider 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.'); } diff --git a/src/Wallabag/CoreBundle/Service/Extractor.php b/src/Wallabag/CoreBundle/Service/Extractor.php index e4ec96f6..6d43a1da 100644 --- a/src/Wallabag/CoreBundle/Service/Extractor.php +++ b/src/Wallabag/CoreBundle/Service/Extractor.php @@ -9,7 +9,7 @@ final class Extractor { 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']; @@ -21,9 +21,10 @@ final class Extractor } /** - * 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) @@ -49,12 +50,12 @@ final class Extractor $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); @@ -67,11 +68,11 @@ final class Extractor // 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]); } } diff --git a/src/Wallabag/CoreBundle/Tools/Utils.php b/src/Wallabag/CoreBundle/Tools/Utils.php index 8fa74491..7e2968e7 100644 --- a/src/Wallabag/CoreBundle/Tools/Utils.php +++ b/src/Wallabag/CoreBundle/Tools/Utils.php @@ -5,7 +5,7 @@ namespace Wallabag\CoreBundle\Tools; class Utils { /** - * Generate a token used for RSS + * Generate a token used for RSS. * * @return string */ diff --git a/src/Wallabag/CoreBundle/Twig/Extension/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/Extension/WallabagExtension.php index 92406865..18388948 100644 --- a/src/Wallabag/CoreBundle/Twig/Extension/WallabagExtension.php +++ b/src/Wallabag/CoreBundle/Twig/Extension/WallabagExtension.php @@ -13,9 +13,10 @@ class WallabagExtension extends \Twig_Extension } /** - * Returns the domain name for a URL + * Returns the domain name for a URL. * * @param $url + * * @return string */ public static function getDomainName($url) @@ -24,9 +25,10 @@ class WallabagExtension extends \Twig_Extension } /** - * 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) -- cgit v1.2.3