diff --git a/src/AbstractZodiac.php b/src/AbstractZodiac.php index ec779bc..ab5c964 100644 --- a/src/AbstractZodiac.php +++ b/src/AbstractZodiac.php @@ -69,7 +69,7 @@ public function match(Carbon $date): bool */ public function localized(?string $locale = null): ?string { - $translator = $this->getTranslator($locale); + $translator = $this->translator($locale); $key = "zodiacs.{$this->name}"; if ($translator->has($key)) { diff --git a/src/Calculator.php b/src/Calculator.php index 86f05a4..cdf86d6 100644 --- a/src/Calculator.php +++ b/src/Calculator.php @@ -40,7 +40,7 @@ public function zodiac(mixed $date): AbstractZodiac foreach ($this->zodiacClassnames() as $classname) { $zodiac = new $classname(); if ($zodiac->match($date)) { - return $zodiac->setTranslator($this->getTranslator()); + return $zodiac->setTranslator($this->translator()); } } diff --git a/src/Laravel/ZodiacBridge.php b/src/Laravel/ZodiacBridge.php index 4f6631c..2f653a5 100644 --- a/src/Laravel/ZodiacBridge.php +++ b/src/Laravel/ZodiacBridge.php @@ -34,7 +34,7 @@ public function __construct(Application $app) */ public function make($date): AbstractZodiac { - return $this->getTranslatableCalculator()->zodiac($date); + return $this->translatableCalculator()->zodiac($date); } /** @@ -43,7 +43,7 @@ public function make($date): AbstractZodiac * @throws InvalidArgumentException * @return Calculator */ - private function getTranslatableCalculator(): Calculator + private function translatableCalculator(): Calculator { return (new Calculator())->setTranslator($this->app['translator']); } diff --git a/src/Traits/CanTranslate.php b/src/Traits/CanTranslate.php index bf6b86c..5d027e1 100644 --- a/src/Traits/CanTranslate.php +++ b/src/Traits/CanTranslate.php @@ -40,7 +40,7 @@ public function setTranslator(Translator $translator): Calculator|AbstractZodiac * @throws InvalidArgumentException * @return Translator */ - public function getTranslator(?string $locale = null): Translator + public function translator(?string $locale = null): Translator { if (is_a($this->translator, Translator::class)) { if (is_string($locale) && $this->translator->getLocale() !== $locale) {