Skip to content

Commit bb4d45e

Browse files
committed
minor symfony#14356 [Translation] LoggingTranslator simplifications (xabbuh)
This PR was merged into the 2.6 branch. Discussion ---------- [Translation] LoggingTranslator simplifications | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- 5d7a4f9 [Translation] LoggingTranslator simplifications
2 parents 85a494c + 5d7a4f9 commit bb4d45e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Symfony/Component/Translation/LoggingTranslator.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface
2020
{
2121
/**
22-
* @var TranslatorInterface
22+
* @var TranslatorInterface|TranslatorBagInterface
2323
*/
2424
private $translator;
2525

@@ -29,13 +29,13 @@ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface
2929
private $logger;
3030

3131
/**
32-
* @param Translator $translator
33-
* @param LoggerInterface $logger
32+
* @param TranslatorInterface $translator The translator must implement TranslatorBagInterface
33+
* @param LoggerInterface $logger
3434
*/
35-
public function __construct($translator, LoggerInterface $logger)
35+
public function __construct(TranslatorInterface $translator, LoggerInterface $logger)
3636
{
37-
if (!($translator instanceof TranslatorInterface && $translator instanceof TranslatorBagInterface)) {
38-
throw new \InvalidArgumentException(sprintf('The Translator "%s" must implements TranslatorInterface and TranslatorBagInterface.', get_class($translator)));
37+
if (!$translator instanceof TranslatorBagInterface) {
38+
throw new \InvalidArgumentException(sprintf('The Translator "%s" must implement TranslatorInterface and TranslatorBagInterface.', get_class($translator)));
3939
}
4040

4141
$this->translator = $translator;

0 commit comments

Comments
 (0)