| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
namespace Carbon\Traits; |
| 15 |
|
| 16 |
use Carbon\FactoryImmutable; |
| 17 |
use Symfony\Contracts\Translation\TranslatorInterface; |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
trait StaticLocalization |
| 23 |
{ |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
public static function setHumanDiffOptions(int $humanDiffOptions): void |
| 30 |
{ |
| 31 |
FactoryImmutable::getDefaultInstance()->setHumanDiffOptions($humanDiffOptions); |
| 32 |
} |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
public static function enableHumanDiffOption(int $humanDiffOption): void |
| 40 |
{ |
| 41 |
FactoryImmutable::getDefaultInstance()->enableHumanDiffOption($humanDiffOption); |
| 42 |
} |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
public static function disableHumanDiffOption(int $humanDiffOption): void |
| 50 |
{ |
| 51 |
FactoryImmutable::getDefaultInstance()->disableHumanDiffOption($humanDiffOption); |
| 52 |
} |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
public static function getHumanDiffOptions(): int |
| 58 |
{ |
| 59 |
return FactoryImmutable::getInstance()->getHumanDiffOptions(); |
| 60 |
} |
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
public static function setTranslator(TranslatorInterface $translator): void |
| 70 |
{ |
| 71 |
FactoryImmutable::getDefaultInstance()->setTranslator($translator); |
| 72 |
} |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
public static function getTranslator(): TranslatorInterface |
| 78 |
{ |
| 79 |
return FactoryImmutable::getInstance()->getTranslator(); |
| 80 |
} |
| 81 |
} |