From e62d571fa67a020fdbcec48eeef144ac1edc42e2 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 21 Feb 2024 21:24:00 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Fixed=20code-style?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Processors/Processor.php | 10 +++++----- src/Resources/Translation.php | 7 +++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Processors/Processor.php b/src/Processors/Processor.php index 5f08c256..023654ae 100644 --- a/src/Processors/Processor.php +++ b/src/Processors/Processor.php @@ -51,9 +51,9 @@ public function __construct( readonly protected Config $config, protected Manager $filesystem = new Manager(), protected ArrHelper $arr = new ArrHelper(), - protected Translation $translation = new Translation() - ) { - } + protected Translation $translation = new Translation( + ) + ) {} public function prepare(): self { @@ -91,7 +91,7 @@ public function store(): void $path = $this->config->langPath($filename); $values - = $this->reset || !File::exists($path) + = $this->reset || ! File::exists($path) ? $values : $this->arr->merge( $this->filesystem->load($path), @@ -121,7 +121,7 @@ protected function collectLocalizations(string $directory): void $locale_alias = $this->toAlias($locale); foreach ($this->file_types as $type) { - $main_path = $this->localeFilename($locale_alias, "$directory/locales/$locale/$type.json"); + $main_path = $this->localeFilename($locale_alias, "$directory/locales/$locale/$type.json"); $inline_path = $this->localeFilename($locale_alias, "$directory/locales/$locale/$type.json", true); $values = $this->filesystem->load($main_path); diff --git a/src/Resources/Translation.php b/src/Resources/Translation.php index ef25986f..875aab77 100644 --- a/src/Resources/Translation.php +++ b/src/Resources/Translation.php @@ -29,8 +29,7 @@ class Translation implements Arrayable public function __construct( readonly protected Arr $arr = new Arr() - ) { - } + ) {} public function setSource(string $namespace, string $filename, array $values): self { @@ -54,12 +53,12 @@ public function toArray(): array $result = []; foreach (array_keys($this->source) as $namespace) { - if (!isset($this->source[$namespace])) { + if (! isset($this->source[$namespace])) { continue; } foreach ($this->source[$namespace] as $filename => $keys) { - if (!isset($this->translations[$namespace])) { + if (! isset($this->translations[$namespace])) { continue; }