From e2fa3c667de35174fddee390bb2be17b4940a6d3 Mon Sep 17 00:00:00 2001 From: Tohid Dadashnejad Date: Wed, 29 Mar 2023 12:22:27 +0200 Subject: [PATCH] Tackle the Style CI (#20) * Tackle the Style CI * Fix LaravelTranslationFileHelper --------- Co-authored-by: Tohid --- src/FileWatcher/Listener.php | 3 +-- src/LaravelTranslationFileHelper.php | 3 +-- src/LaravelVueTranslation.php | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/FileWatcher/Listener.php b/src/FileWatcher/Listener.php index afed25c..793a95f 100644 --- a/src/FileWatcher/Listener.php +++ b/src/FileWatcher/Listener.php @@ -1,6 +1,5 @@ getLine()}] - [{$exception->getFile()}]", CLIPrinter::FOREGROUND_WHITE, CLIPrinter::BACKGROUND_RED); CLIPrinter::print($exception->getMessage()); } + return false; } @@ -51,7 +51,6 @@ public function onCreated(FileSystemEvent $event) */ public function onModified(FileSystemEvent $event) { - } /** diff --git a/src/LaravelTranslationFileHelper.php b/src/LaravelTranslationFileHelper.php index e1533c9..cde6f77 100644 --- a/src/LaravelTranslationFileHelper.php +++ b/src/LaravelTranslationFileHelper.php @@ -7,7 +7,6 @@ class LaravelTranslationFileHelper implements TranslationFileHelper { - /** * @return \Symfony\Component\Finder\SplFileInfo[] */ @@ -24,7 +23,7 @@ public function write(array $data) if (!File::exists($this->destinationPath())) { File::makeDirectory($this->destinationPath(), 0755, true, true); } - File::put($this->destinationPath() . '/translations.json', json_encode($data)); + File::put($this->destinationPath().'/translations.json', json_encode($data)); } /** diff --git a/src/LaravelVueTranslation.php b/src/LaravelVueTranslation.php index ae17b0b..ed8f6ed 100644 --- a/src/LaravelVueTranslation.php +++ b/src/LaravelVueTranslation.php @@ -62,7 +62,7 @@ private function setTranslations() $nestedArray = $this->addArrayLevels( $array, [], - $file->getExtension() === 'json' + $file->getExtension() === 'json' ? json_decode(file_get_contents($file->getPathName()), true) : require $file->getPathName() );