aboutsummaryrefslogtreecommitdiff
path: root/cli/check.translation.php
diff options
context:
space:
mode:
Diffstat (limited to 'cli/check.translation.php')
-rwxr-xr-xcli/check.translation.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/cli/check.translation.php b/cli/check.translation.php
index b452054ed..d209383a8 100755
--- a/cli/check.translation.php
+++ b/cli/check.translation.php
@@ -82,7 +82,7 @@ if (!$isValidated) {
* Iterates through all php and phtml files in the whole project and extracts all
* translation keys used.
*
- * @return array<string>
+ * @return list<string>
*/
function findUsedTranslations(): array {
$directory = new RecursiveDirectoryIterator(__DIR__ . '/..');
@@ -90,6 +90,9 @@ function findUsedTranslations(): array {
$regex = new RegexIterator($iterator, '/^.+\.(php|phtml)$/i', RecursiveRegexIterator::GET_MATCH);
$usedI18n = [];
foreach (array_keys(iterator_to_array($regex)) as $file) {
+ if (!is_string($file) || $file === '') {
+ continue;
+ }
$fileContent = file_get_contents($file);
if ($fileContent === false) {
continue;