diff --git a/src/EventSubscriber/CheckRequirementsSubscriber.php b/src/EventSubscriber/CheckRequirementsSubscriber.php index 2078b5a2b..fe9def3b0 100644 --- a/src/EventSubscriber/CheckRequirementsSubscriber.php +++ b/src/EventSubscriber/CheckRequirementsSubscriber.php @@ -30,12 +30,8 @@ */ class CheckRequirementsSubscriber implements EventSubscriberInterface { - /** @var EntityManagerInterface */ private $entityManager; - /** - * @param EntityManagerInterface $entityManager - */ public function __construct(EntityManagerInterface $entityManager) { $this->entityManager = $entityManager; @@ -60,8 +56,6 @@ public static function getSubscribedEvents() * This method checks if there has been an error in a command related to * the database and then, it checks if the 'sqlite3' PHP extension is enabled * or not to display a better error message. - * - * @param ConsoleErrorEvent $event */ public function handleConsoleError(ConsoleErrorEvent $event) { @@ -78,8 +72,6 @@ public function handleConsoleError(ConsoleErrorEvent $event) /** * This method checks if the triggered exception is related to the database * and then, it checks if the required 'sqlite3' PHP extension is enabled. - * - * @param GetResponseForExceptionEvent $event */ public function handleKernelException(GetResponseForExceptionEvent $event) { diff --git a/src/EventSubscriber/CommentNotificationSubscriber.php b/src/EventSubscriber/CommentNotificationSubscriber.php index 1e54dc5e3..578b926a3 100644 --- a/src/EventSubscriber/CommentNotificationSubscriber.php +++ b/src/EventSubscriber/CommentNotificationSubscriber.php @@ -25,34 +25,11 @@ */ class CommentNotificationSubscriber implements EventSubscriberInterface { - /** - * @var \Swift_Mailer - */ private $mailer; - - /** - * @var TranslatorInterface - */ private $translator; - - /** - * @var UrlGeneratorInterface - */ private $urlGenerator; - - /** - * @var string - */ private $sender; - /** - * Constructor. - * - * @param \Swift_Mailer $mailer - * @param UrlGeneratorInterface $urlGenerator - * @param TranslatorInterface $translator - * @param string $sender - */ public function __construct(\Swift_Mailer $mailer, UrlGeneratorInterface $urlGenerator, TranslatorInterface $translator, $sender) { $this->mailer = $mailer; @@ -68,9 +45,6 @@ public static function getSubscribedEvents() ]; } - /** - * @param GenericEvent $event - */ public function onCommentCreated(GenericEvent $event) { /** @var Comment $comment */ diff --git a/src/EventSubscriber/RedirectToPreferredLocaleSubscriber.php b/src/EventSubscriber/RedirectToPreferredLocaleSubscriber.php index 9ece99b6f..495ab9011 100644 --- a/src/EventSubscriber/RedirectToPreferredLocaleSubscriber.php +++ b/src/EventSubscriber/RedirectToPreferredLocaleSubscriber.php @@ -80,9 +80,6 @@ public static function getSubscribedEvents() ]; } - /** - * @param GetResponseEvent $event - */ public function onKernelRequest(GetResponseEvent $event) { $request = $event->getRequest(); diff --git a/src/Twig/AppExtension.php b/src/Twig/AppExtension.php index ee5ab7604..f912fe3a7 100644 --- a/src/Twig/AppExtension.php +++ b/src/Twig/AppExtension.php @@ -29,20 +29,14 @@ */ class AppExtension extends \Twig_Extension { - /** - * @var Markdown - */ private $parser; - - /** - * @var array - */ + private $localeCodes; private $locales; public function __construct(Markdown $parser, $locales) { $this->parser = $parser; - $this->locales = $locales; + $this->localeCodes = explode('|', $locales); } /** @@ -86,13 +80,15 @@ public function markdownToHtml($content) */ public function getLocales() { - $localeCodes = explode('|', $this->locales); + if (null !== $this->locales) { + return $this->locales; + } - $locales = []; - foreach ($localeCodes as $localeCode) { - $locales[] = ['code' => $localeCode, 'name' => Intl::getLocaleBundle()->getLocaleName($localeCode, $localeCode)]; + $this->locales = []; + foreach ($this->localeCodes as $localeCode) { + $this->locales[] = ['code' => $localeCode, 'name' => Intl::getLocaleBundle()->getLocaleName($localeCode, $localeCode)]; } - return $locales; + return $this->locales; } } diff --git a/src/Utils/Markdown.php b/src/Utils/Markdown.php index c274a9eae..a2c45996b 100644 --- a/src/Utils/Markdown.php +++ b/src/Utils/Markdown.php @@ -21,14 +21,7 @@ */ class Markdown { - /** - * @var \Parsedown - */ private $parser; - - /** - * @var \HTMLPurifier - */ private $purifier; public function __construct()