feature #28626 [Translation] marked getFallbackLocales() as internal (boscho87)

This PR was merged into the 4.2-dev branch.

Discussion
----------

[Translation] marked getFallbackLocales() as internal

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #28579
| License       | MIT
| Doc PR        |

Added the deprication trigger error function to getFallbackLocales in the Translation component.

(Its my first PR, please tell me if i need to change something)

Commits
-------

9d67a68816 [Translation] marked getFallbackLocales() as internal
This commit is contained in:
Fabien Potencier 2018-10-03 09:51:39 +02:00
commit 679f8d9c9b
5 changed files with 8 additions and 0 deletions

View File

@ -209,6 +209,7 @@ Translation
* The `TranslatorInterface` has been deprecated in favor of `Symfony\Contracts\Translation\TranslatorInterface`
* The `MessageSelector`, `Interval` and `PluralizationRules` classes have been deprecated, use `IdentityTranslator` instead
* The `Translator::getFallbackLocales()` and `TranslationDataCollector::getFallbackLocales()` method have been marked as internal
Validator
---------

View File

@ -184,6 +184,7 @@ Translation
* The `TranslationWriter::disableBackup()` method has been removed.
* The `TranslatorInterface` has been removed in favor of `Symfony\Contracts\Translation\TranslatorInterface`
* The `MessageSelector`, `Interval` and `PluralizationRules` classes have been removed, use `IdentityTranslator` instead
* The `Translator::getFallbackLocales()` and `TranslationDataCollector::getFallbackLocales()` method are now internal
TwigBundle
----------

View File

@ -9,6 +9,7 @@ CHANGELOG
* deprecated `MessageSelector`, `Interval` and `PluralizationRules`; use `IdentityTranslator` instead
* Added `IntlMessageFormatter` and `FallbackMessageFormatter`
* added support for multiple files and directories in `XliffLintCommand`
* Marked `Translator::getFallbackLocales()` and `TranslationDataCollector::getFallbackLocales()` as internal
4.1.0
-----

View File

@ -97,6 +97,9 @@ class TranslationDataCollector extends DataCollector implements LateDataCollecto
return !empty($this->data['locale']) ? $this->data['locale'] : null;
}
/**
* @internal since Symfony 4.2
*/
public function getFallbackLocales()
{
return (isset($this->data['fallback_locales']) && \count($this->data['fallback_locales']) > 0) ? $this->data['fallback_locales'] : array();

View File

@ -176,6 +176,8 @@ class Translator implements TranslatorInterface, TranslatorBagInterface
/**
* Gets the fallback locales.
*
* @internal since Symfony 4.2
*
* @return array $locales The fallback locales
*/
public function getFallbackLocales()