Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion UPGRADE-8.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ Translation
-$loader->setCsvControl(';', '"', '\\');
+$loader->setCsvControl(';', '"');
```

* Remove `TranslatableMessage::__toString()` method, use `trans()` or `getMessage()` instead
* Make `DataCollectorTranslator` class `final`
* Remove `ProviderFactoryTestCase`, extend `AbstractProviderFactoryTestCase` instead

Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/Translation/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ CHANGELOG
* Remove the `$escape` parameter from `CsvFileLoader::setCsvControl()`
* Make `DataCollectorTranslator` class `final`
* Remove `ProviderFactoryTestCase`, extend `AbstractProviderFactoryTestCase` instead
* Remove `TranslatableMessage::__toString()` method, use `trans()` or `getMessage()` instead

7.4
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,6 @@ public function testFlattenedTrans($expected, $messages, $translatable)
$this->assertSame($expected, $translatable->trans($translator, 'fr'));
}

/**
* @group legacy
*/
public function testToString()
{
$this->assertSame('Symfony is great!', (string) new TranslatableMessage('Symfony is great!'));
}

public static function getTransTests()
{
return [
Expand Down
10 changes: 0 additions & 10 deletions src/Symfony/Component/Translation/TranslatableMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,6 @@ public function __construct(
) {
}

/**
* @deprecated since Symfony 7.4
*/
public function __toString(): string
{
trigger_deprecation('symfony/translation', '7.4', 'Method "%s()" is deprecated.', __METHOD__);

return $this->getMessage();
}

public function getMessage(): string
{
return $this->message;
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Translation/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"require": {
"php": ">=8.4",
"symfony/polyfill-mbstring": "^1.0",
"symfony/translation-contracts": "^2.5|^3.0"
"symfony/translation-contracts": "^3.6.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nicolas-grekas

There is currently no 3.6.1 tag of symfony/translation-contracts.
https://github.com/symfony/translation-contracts/tags

This lead to the error

Problem 1
    - Root composer.json requires symfony/translation ^5.4 || ^6.4 || ^7.0 || ^8.0 -> satisfiable by symfony/translation[v8.0.0-BETA1].
    - symfony/translation v8.0.0-BETA1 requires symfony/translation-contracts ^3.6.1 -> found symfony/translation-contracts[dev-main, 3.6.x-dev (alias of dev-main)] but it does not match your minimum-stability.

when trying to support 8.0 ; would it be possible to create a new tag or relax the condition ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicolas-grekas why was this requirement changed ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #62336

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VincentLanglet 3.6.1 has been tagged

},
"require-dev": {
"nikic/php-parser": "^5.0",
Expand Down
Loading