Copied!

ProviderValidatorInterface

ProviderValidatorInterface.php : 24
Interface

Provider-specific validator for translation input.

Allows each translation provider to define its own validation rules (e.g., max text length, language code format, supported languages).

Methods

publicvalidatePostNormalizationLanguageCode()

ProviderValidatorInterface.php : 45
public validatePostNormalizationLanguageCode(TranslationProviderInterface $provider, string $languageCode, LanguageRole $role) : void

Parameters

Name Type Default value Description
$provider TranslationProviderInterface - -
$languageCode string - -
$role LanguageRole - -
Tags
Throws
EmptyLanguageCodeException
Throws
InvalidLanguageCodeFormatException
Throws
UnsupportedLanguageException

publicvalidatePreNormalizationLanguageCodeFormat()

ProviderValidatorInterface.php : 29
public validatePreNormalizationLanguageCodeFormat(string $languageCode, LanguageRole $role) : void

Parameters

Name Type Default value Description
$languageCode string - -
$role LanguageRole - -
Tags
Throws
InvalidLanguageCodeFormatException

publicvalidateText()

ProviderValidatorInterface.php : 38
public validateText(string $text) : void

Parameters

Name Type Default value Description
$text string - -
Tags
Throws
EmptyTextException
Throws
TextTooLargeException