Skip to content

Commit 599dfcf

Browse files
committed
deprecate transChoice method
1 parent a21c342 commit 599dfcf

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

src/Symfony/Component/Translation/IdentityTranslator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public function trans($id, array $parameters = array(), $domain = null, $locale
8989
*/
9090
public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null)
9191
{
92+
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0. Rely on the MessageFormatterInterface and TranslatorInterface::trans() method instead.', E_USER_DEPRECATED);
9293
if (!$locale) {
9394
$locale = $this->getLocale();
9495
}

src/Symfony/Component/Translation/Translator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ public function trans($id, array $parameters = array(), $domain = null, $locale
256256
*/
257257
public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null)
258258
{
259+
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0. Rely on the MessageFormatterInterface and TranslatorInterface::trans() method instead.', E_USER_DEPRECATED);
259260
if (null === $domain) {
260261
$domain = 'messages';
261262
}

src/Symfony/Component/Translation/TranslatorInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public function trans($id, array $parameters = array(), $domain = null, $locale
3838

3939
/**
4040
* Translates the given choice message by choosing a translation according to a number.
41+
* @deprecated since version 2.8, to be removed in 3.0.
42+
* Use the {@link trans} method instead.
4143
*
4244
* @param string $id The message id (may also be an object that can be cast to string)
4345
* @param int $number The number to use to find the indice of the message

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy