Skip to content

Commit 2aa7181

Browse files
committed
Fixes according to feedback
1 parent a325a44 commit 2aa7181

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

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

+1-9
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
1616
* @author Abdellatif Ait boudad <a.aitboudad@gmail.com>
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

+1-5
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)