Skip to content

Commit a5a2e6b

Browse files
committed
minor #639 Remove useless PhpDoc comments and minor improvements (yceruto)
This PR was squashed before being merged into the master branch (closes #639). Discussion ---------- Remove useless PhpDoc comments and minor improvements * Remove useless PhpDocs comments. * Improving Twig `locales()` function. Commits ------- e406974 Remove useless PhpDoc comments and minor improvements
2 parents f4a58f5 + e406974 commit a5a2e6b

File tree

5 files changed

+9
-57
lines changed

5 files changed

+9
-57
lines changed

src/EventSubscriber/CheckRequirementsSubscriber.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,8 @@
3030
*/
3131
class CheckRequirementsSubscriber implements EventSubscriberInterface
3232
{
33-
/** @var EntityManagerInterface */
3433
private $entityManager;
3534

36-
/**
37-
* @param EntityManagerInterface $entityManager
38-
*/
3935
public function __construct(EntityManagerInterface $entityManager)
4036
{
4137
$this->entityManager = $entityManager;
@@ -60,8 +56,6 @@ public static function getSubscribedEvents()
6056
* This method checks if there has been an error in a command related to
6157
* the database and then, it checks if the 'sqlite3' PHP extension is enabled
6258
* or not to display a better error message.
63-
*
64-
* @param ConsoleErrorEvent $event
6559
*/
6660
public function handleConsoleError(ConsoleErrorEvent $event)
6761
{
@@ -78,8 +72,6 @@ public function handleConsoleError(ConsoleErrorEvent $event)
7872
/**
7973
* This method checks if the triggered exception is related to the database
8074
* and then, it checks if the required 'sqlite3' PHP extension is enabled.
81-
*
82-
* @param GetResponseForExceptionEvent $event
8375
*/
8476
public function handleKernelException(GetResponseForExceptionEvent $event)
8577
{

src/EventSubscriber/CommentNotificationSubscriber.php

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,34 +25,11 @@
2525
*/
2626
class CommentNotificationSubscriber implements EventSubscriberInterface
2727
{
28-
/**
29-
* @var \Swift_Mailer
30-
*/
3128
private $mailer;
32-
33-
/**
34-
* @var TranslatorInterface
35-
*/
3629
private $translator;
37-
38-
/**
39-
* @var UrlGeneratorInterface
40-
*/
4130
private $urlGenerator;
42-
43-
/**
44-
* @var string
45-
*/
4631
private $sender;
4732

48-
/**
49-
* Constructor.
50-
*
51-
* @param \Swift_Mailer $mailer
52-
* @param UrlGeneratorInterface $urlGenerator
53-
* @param TranslatorInterface $translator
54-
* @param string $sender
55-
*/
5633
public function __construct(\Swift_Mailer $mailer, UrlGeneratorInterface $urlGenerator, TranslatorInterface $translator, $sender)
5734
{
5835
$this->mailer = $mailer;
@@ -68,9 +45,6 @@ public static function getSubscribedEvents()
6845
];
6946
}
7047

71-
/**
72-
* @param GenericEvent $event
73-
*/
7448
public function onCommentCreated(GenericEvent $event)
7549
{
7650
/** @var Comment $comment */

src/EventSubscriber/RedirectToPreferredLocaleSubscriber.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ public static function getSubscribedEvents()
8080
];
8181
}
8282

83-
/**
84-
* @param GetResponseEvent $event
85-
*/
8683
public function onKernelRequest(GetResponseEvent $event)
8784
{
8885
$request = $event->getRequest();

src/Twig/AppExtension.php

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,14 @@
2929
*/
3030
class AppExtension extends \Twig_Extension
3131
{
32-
/**
33-
* @var Markdown
34-
*/
3532
private $parser;
36-
37-
/**
38-
* @var array
39-
*/
33+
private $localeCodes;
4034
private $locales;
4135

4236
public function __construct(Markdown $parser, $locales)
4337
{
4438
$this->parser = $parser;
45-
$this->locales = $locales;
39+
$this->localeCodes = explode('|', $locales);
4640
}
4741

4842
/**
@@ -86,13 +80,15 @@ public function markdownToHtml($content)
8680
*/
8781
public function getLocales()
8882
{
89-
$localeCodes = explode('|', $this->locales);
83+
if (null !== $this->locales) {
84+
return $this->locales;
85+
}
9086

91-
$locales = [];
92-
foreach ($localeCodes as $localeCode) {
93-
$locales[] = ['code' => $localeCode, 'name' => Intl::getLocaleBundle()->getLocaleName($localeCode, $localeCode)];
87+
$this->locales = [];
88+
foreach ($this->localeCodes as $localeCode) {
89+
$this->locales[] = ['code' => $localeCode, 'name' => Intl::getLocaleBundle()->getLocaleName($localeCode, $localeCode)];
9490
}
9591

96-
return $locales;
92+
return $this->locales;
9793
}
9894
}

src/Utils/Markdown.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,7 @@
2121
*/
2222
class Markdown
2323
{
24-
/**
25-
* @var \Parsedown
26-
*/
2724
private $parser;
28-
29-
/**
30-
* @var \HTMLPurifier
31-
*/
3225
private $purifier;
3326

3427
public function __construct()

0 commit comments

Comments
 (0)