Issue #3030485 by catch, R.shaikh, Gábor Hojtsy, alexpott: [Symfony 5] The "Drupal\Core\Validation\TranslatorInterface" interface extends "Symfony\Component\Translation\TranslatorInterface" that is deprecated since Symfony 4.2, use Symfony\Contracts\Translation\TranslatorInterface instead

8.7.x
Gábor Hojtsy 2019-02-26 13:54:26 +01:00
parent f5cd28b7b8
commit dd054699a4
1 changed files with 23 additions and 6 deletions

View File

@ -2,18 +2,35 @@
namespace Drupal\Core\Validation;
use Symfony\Component\Translation\TranslatorInterface as SymfonyTranslatorInterface;
/**
* Defines an interface used in validation.
*
* This extends the interface used by the Symfony validator in order to indicate
* that the Drupal code is actually independent from the Symfony translation
* component.
* This replaces the interface used by the Symfony validator in order
* to indicate that the Drupal code is actually independent from the
* Symfony translation component.
*
* @see https://github.com/symfony/symfony/pull/6189
* @see https://github.com/symfony/symfony/issues/15714
*/
interface TranslatorInterface extends SymfonyTranslatorInterface {
interface TranslatorInterface {
/**
* Translates the given message.
*
* @param string $id
* The message id (may also be an object that can be cast to string).
* @param array $parameters
* An array of parameters for the message.
* @param string|null $domain
* The domain for the message or null to use the default.
* @param string|null $locale
* The locale or null to use the default.
* @return string
* The translated string.
*
* @throws InvalidArgumentException
* If the locale contains invalid characters.
*/
public function trans($id, array $parameters = [], $domain = NULL, $locale = NULL);
}