Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c5a4f86

Browse files
committed
Fixes according to feedback
1 parent 93c6e5b commit c5a4f86

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

src/Symfony/Component/Translation/Formatter/IntlMessageFormatter.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* @author Guilherme Blanco <[email protected]>
1616
* @author Abdellatif Ait boudad <[email protected]>
1717
*/
18-
class IntlMessageFormatter implements MessageFormatterInterface, ChoiceMessageFormatterInterface
18+
class IntlMessageFormatter implements MessageFormatterInterface
1919
{
2020
/**
2121
* {@inheritdoc}
@@ -38,12 +38,4 @@ public function format($message, $locale, array $parameters = array())
3838

3939
return $message;
4040
}
41-
42-
/**
43-
* {@inheritdoc}
44-
*/
45-
public function choiceFormat($message, $number, $locale, array $parameters = array())
46-
{
47-
return $this->format($message, $locale, $parameters);
48-
}
4941
}

src/Symfony/Component/Translation/Translator.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,17 +205,13 @@ public function trans($id, array $parameters = array(), $domain = null, $locale
205205
*/
206206
public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null)
207207
{
208-
if (!$this->formatter instanceof ChoiceMessageFormatterInterface) {
209-
throw new LogicException(sprintf('The formatter "%s" does not support plural translations.', \get_class($this->formatter)));
210-
}
211-
212208
if (null === $domain) {
213209
$domain = 'messages';
214210
}
215211

216212
$formatter = $this->getFormatter($domain);
217213
if (!$formatter instanceof ChoiceMessageFormatterInterface) {
218-
throw new LogicException(sprintf('The formatter "%s" does not support plural translations.', get_class($formatter)));
214+
throw new LogicException(sprintf('The formatter "%s" does not support plural translations.', \get_class($formatter)));
219215
}
220216

221217
$id = (string) $id;

0 commit comments

Comments
 (0)