diff --git a/config/public.php b/config/public.php index c78f093..ce74981 100644 --- a/config/public.php +++ b/config/public.php @@ -19,7 +19,7 @@ * By default, `false`. */ - 'inline' => (bool) env('LOCALIZATION_INLINE', false), + 'inline' => (bool)env('LOCALIZATION_INLINE', false), /* * Do arrays need to be aligned by keys before processing arrays? @@ -27,7 +27,7 @@ * By default, true */ - 'align' => (bool) env('LOCALIZATION_ALIGN', true), + 'align' => (bool)env('LOCALIZATION_ALIGN', true), /* * This option determines the mechanism for converting translation @@ -41,7 +41,7 @@ */ 'smart_punctuation' => [ - 'enable' => (bool) env('LOCALIZATION_SMART_ENABLED', false), + 'enable' => (bool)env('LOCALIZATION_SMART_ENABLED', false), 'common' => [ 'double_quote_opener' => '“', diff --git a/src/Data/HiddenData.php b/src/Data/HiddenData.php new file mode 100644 index 0000000..2698cd4 --- /dev/null +++ b/src/Data/HiddenData.php @@ -0,0 +1,15 @@ +items; + } + + public function push(mixed $value): static + { + $this->items[] = $value; + + return $this; + } + + public function set(int | string $key, mixed $value): static + { + $this->items[$key] = $value; + + return $this; + } +} diff --git a/src/Data/SharedData.php b/src/Data/SharedData.php new file mode 100644 index 0000000..1c73c52 --- /dev/null +++ b/src/Data/SharedData.php @@ -0,0 +1,16 @@ +value . '.' . $key); + + return is_null($object) ? $value : new $object($value); + } + + protected static function repository(string $key): mixed + { + return app(Repository::class)->get($key); + } +}