Skip to content

Commit 9aa04d4

Browse files
[Translation] Remove TranslatableMessage::__toString() method, use trans() instead
1 parent 8dd2c5c commit 9aa04d4

File tree

4 files changed

+2
-19
lines changed

4 files changed

+2
-19
lines changed

UPGRADE-8.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ Translation
503503
-$loader->setCsvControl(';', '"', '\\');
504504
+$loader->setCsvControl(';', '"');
505505
```
506-
506+
* Remove `TranslatableMessage::__toString()` method, use `trans()` instead
507507
* Make `DataCollectorTranslator` class `final`
508508
* Remove `ProviderFactoryTestCase`, extend `AbstractProviderFactoryTestCase` instead
509509

src/Symfony/Component/Translation/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ CHANGELOG
77
* Remove the `$escape` parameter from `CsvFileLoader::setCsvControl()`
88
* Make `DataCollectorTranslator` class `final`
99
* Remove `ProviderFactoryTestCase`, extend `AbstractProviderFactoryTestCase` instead
10+
* Remove `TranslatableMessage::__toString()` method, use `trans()` instead
1011

1112
7.4
1213
---

src/Symfony/Component/Translation/Tests/TranslatableTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,6 @@ public function testFlattenedTrans($expected, $messages, $translatable)
4242
$this->assertSame($expected, $translatable->trans($translator, 'fr'));
4343
}
4444

45-
/**
46-
* @group legacy
47-
*/
48-
public function testToString()
49-
{
50-
$this->assertSame('Symfony is great!', (string) new TranslatableMessage('Symfony is great!'));
51-
}
52-
5345
public static function getTransTests()
5446
{
5547
return [

src/Symfony/Component/Translation/TranslatableMessage.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@ public function __construct(
2626
) {
2727
}
2828

29-
/**
30-
* @deprecated since Symfony 7.4
31-
*/
32-
public function __toString(): string
33-
{
34-
trigger_deprecation('symfony/translation', '7.4', 'Method "%s()" is deprecated.', __METHOD__);
35-
36-
return $this->getMessage();
37-
}
38-
3929
public function getMessage(): string
4030
{
4131
return $this->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