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", 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 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 + } } }