From 25d405989ff42981c1994ecc920e48670f92d5f4 Mon Sep 17 00:00:00 2001 From: Laurynas Sakalauskas Date: Mon, 4 Feb 2019 10:23:14 +0100 Subject: [PATCH 1/3] Do not throw exception when language file does not exist --- src/Manager.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Manager.php b/src/Manager.php index 4ff5824..5ac11df 100644 --- a/src/Manager.php +++ b/src/Manager.php @@ -186,11 +186,15 @@ public function removeKey($fileName, $key) foreach ($this->languages() as $language) { $filePath = $this->path."/{$language}/{$fileName}.php"; - $fileContent = $this->getFileContent($filePath); + try { + $fileContent = $this->getFileContent($filePath); - Arr::forget($fileContent, $key); + Arr::forget($fileContent, $key); - $this->writeFile($filePath, $fileContent); + $this->writeFile($filePath, $fileContent); + } catch (FileNotFoundException $e) { + // If there is no language file, continue + } } } From be0ba54d70af9b4e46210b93bc9c9278a0a83c24 Mon Sep 17 00:00:00 2001 From: Laurynas Sakalauskas Date: Mon, 9 Dec 2019 12:55:58 +0200 Subject: [PATCH 2/3] Laravel 6 support --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 580cfe6..fe1349c 100644 --- a/composer.json +++ b/composer.json @@ -13,9 +13,9 @@ ], "require": { "php": "^5.5.9 || ^7.0", - "illuminate/support": "~5.1", - "illuminate/console": "~5.1", - "illuminate/filesystem": "~5.1" + "illuminate/support": "~5.1 | ^6.0", + "illuminate/console": "~5.1 | ^6.0", + "illuminate/filesystem": "~5.1 | ^6.0" }, "require-dev": { "phpunit/phpunit" : "^4.8 || ^5.0", From e683681210c4245ce4d9671e99cffffdc0b7bbbf Mon Sep 17 00:00:00 2001 From: Laurynas Sakalauskas Date: Mon, 9 Dec 2019 14:01:13 +0200 Subject: [PATCH 3/3] Update support for PHP 7.4 --- src/Commands/FindCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Commands/FindCommand.php b/src/Commands/FindCommand.php index 73cad05..fcc63a2 100644 --- a/src/Commands/FindCommand.php +++ b/src/Commands/FindCommand.php @@ -112,7 +112,7 @@ private function tableRows() $original[$languageKey] = isset($values[$languageKey]) ? $values[$languageKey] - : isset($filesContent[$fileName][$languageKey][$key]) ? $filesContent[$fileName][$languageKey][$key] : ''; + : (isset($filesContent[$fileName][$languageKey][$key]) ? $filesContent[$fileName][$languageKey][$key] : ''); } // Sort the language values based on language name