| Total Complexity | 9 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class Translator implements Contract |
||
| 9 | { |
||
| 10 | /** @var \Illuminate\Contracts\Config\Repository */ |
||
| 11 | protected $config; |
||
| 12 | |||
| 13 | public function __construct(Repository $config) |
||
| 14 | { |
||
| 15 | $this->config = $config; |
||
| 16 | } |
||
| 17 | |||
| 18 | public function activateLanguage(string $languageCode): void |
||
| 19 | { |
||
| 20 | $this->config->set('translator.active_language_code', $languageCode); |
||
| 21 | } |
||
| 22 | |||
| 23 | public function activeLanguageCode(): ?string |
||
| 26 | } |
||
| 27 | |||
| 28 | public function autoTranslates(): bool |
||
| 29 | { |
||
| 30 | return (bool) $this->config->get('translator.auto_translate_attributes', false); |
||
| 31 | } |
||
| 32 | |||
| 33 | public function defaultLanguageCode(): string |
||
| 34 | { |
||
| 35 | return $this->config->get('translator.default_language_code'); |
||
| 36 | } |
||
| 37 | |||
| 38 | public function disableAutoTranslation(): void |
||
| 39 | { |
||
| 40 | $this->config->set('translator.auto_translate_attributes', false); |
||
| 41 | } |
||
| 42 | |||
| 43 | public function enableAutoTranslation(): void |
||
| 44 | { |
||
| 45 | $this->config->set('translator.auto_translate_attributes', true); |
||
| 46 | } |
||
| 47 | |||
| 48 | public function isDefaultLanguage(string $languageCode): bool |
||
| 49 | { |
||
| 50 | return $this->defaultLanguageCode() === $languageCode; |
||
| 51 | } |
||
| 52 | |||
| 53 | public function softDeletes(): bool |
||
| 56 | } |
||
| 57 | } |
||
| 58 |