From b0035b8bfd881a82bffb6a8c66880387f1d5f4dc Mon Sep 17 00:00:00 2001 From: Andrii Trush Date: Tue, 22 Oct 2024 21:18:47 +0200 Subject: [PATCH] pint refactoring --- config/config.php | 2 +- src/Concerns/HasLabel.php | 7 ++++--- src/Concerns/InteractWithCollection.php | 4 +++- src/Contracts/HasLabel.php | 4 +++- src/ServiceProvider.php | 2 +- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/config/config.php b/config/config.php index bc2ef42..0e72a65 100644 --- a/config/config.php +++ b/config/config.php @@ -1,6 +1,6 @@ [ diff --git a/src/Concerns/HasLabel.php b/src/Concerns/HasLabel.php index 7d1c2c9..5b7533d 100644 --- a/src/Concerns/HasLabel.php +++ b/src/Concerns/HasLabel.php @@ -1,11 +1,12 @@ name])); + return trans(vsprintf('%s%s%s.%s', [$namespace, $prefix, \get_class($this), $this->name])); } protected function getPrefix(): ?string @@ -39,4 +40,4 @@ protected function getNamespace(): ?string { return Config::get('enum-helpers.label.namespace'); } -} \ No newline at end of file +} diff --git a/src/Concerns/InteractWithCollection.php b/src/Concerns/InteractWithCollection.php index 24a7f99..968601d 100644 --- a/src/Concerns/InteractWithCollection.php +++ b/src/Concerns/InteractWithCollection.php @@ -1,5 +1,7 @@ mapWithKeys(fn ($enum) => [$enum->name => $enum->value]); } -} \ No newline at end of file +} diff --git a/src/Contracts/HasLabel.php b/src/Contracts/HasLabel.php index f79a359..21f9495 100644 --- a/src/Contracts/HasLabel.php +++ b/src/Contracts/HasLabel.php @@ -1,8 +1,10 @@