Skip to content

Commit 551e32d

Browse files
committed
improve deprecation messages
1 parent 7047f72 commit 551e32d

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

DependencyInjection/TranslatorPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class TranslatorPass implements CompilerPassInterface
2727
public function __construct($translatorServiceId = 'translator.default', $readerServiceId = 'translation.loader', $loaderTag = 'translation.loader', $debugCommandServiceId = 'console.command.translation_debug', $updateCommandServiceId = 'console.command.translation_update')
2828
{
2929
if ('translation.loader' === $readerServiceId && 2 > func_num_args()) {
30-
@trigger_error('The default value for $readerServiceId will change in 4.0 to "translation.reader".', E_USER_DEPRECATED);
30+
@trigger_error(sprintf('The default value for $readerServiceId in "%s()" will change in 4.0 to "translation.reader".', __METHOD__), E_USER_DEPRECATED);
3131
}
3232

3333
$this->translatorServiceId = $translatorServiceId;

Tests/DependencyInjection/TranslationPassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function testValidCollector()
5757

5858
/**
5959
* @group legacy
60-
* @expectedDeprecation The default value for $readerServiceId will change in 4.0 to "translation.reader".
60+
* @expectedDeprecation The default value for $readerServiceId in "Symfony\Component\Translation\DependencyInjection\TranslatorPass::__construct()" will change in 4.0 to "translation.reader".
6161
*
6262
* A test that verifies the deprecated "translation.loader" gets the LoaderInterfaces added.
6363
*

Tests/Writer/TranslationWriterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class TranslationWriterTest extends TestCase
2020
{
2121
/**
2222
* @group legacy
23-
* @expectedDeprecation Method Symfony\Component\Translation\Writer\TranslationWriter::writeTranslations() is deprecated since Symfony 3.4 and will be removed in 4.0. Use write() instead.
23+
* @expectedDeprecation The "Symfony\Component\Translation\Writer\TranslationWriter::writeTranslations()" method is deprecated since Symfony 3.4 and will be removed in 4.0. Use write() instead.
2424
*/
2525
public function testWriteTranslations()
2626
{

Translator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function __construct($locale, $formatter = null, $cacheDir = null, $debug
8787

8888
if ($formatter instanceof MessageSelector) {
8989
$formatter = new MessageFormatter($formatter);
90-
@trigger_error(sprintf('Passing a "%s" instance into the "%s" as a second argument is deprecated since Symfony 3.4 and will be removed in 4.0. Inject a "%s" implementation instead.', MessageSelector::class, __METHOD__, MessageFormatterInterface::class), E_USER_DEPRECATED);
90+
@trigger_error(sprintf('Passing a "%s" instance into the "%s()" method as a second argument is deprecated since Symfony 3.4 and will be removed in 4.0. Inject a "%s" implementation instead.', MessageSelector::class, __METHOD__, MessageFormatterInterface::class), E_USER_DEPRECATED);
9191
} elseif (null === $formatter) {
9292
$formatter = new MessageFormatter();
9393
}

Writer/TranslationWriter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function write(MessageCatalogue $catalogue, $format, $options = array())
9797
*/
9898
public function writeTranslations(MessageCatalogue $catalogue, $format, $options = array())
9999
{
100-
@trigger_error(sprintf('Method %s() is deprecated since Symfony 3.4 and will be removed in 4.0. Use write() instead.', __METHOD__), E_USER_DEPRECATED);
100+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0. Use write() instead.', __METHOD__), E_USER_DEPRECATED);
101101
$this->write($catalogue, $format, $options);
102102
}
103103
}

0 commit comments

Comments
 (0)