From 92b6b6babb0b7f718faff32e63294a157be35b97 Mon Sep 17 00:00:00 2001 From: Bayi Date: Mon, 31 Oct 2016 20:59:19 +0100 Subject: [PATCH] Ignore non php files in resources/lang folders, for example .gitignore and vim swap files are causing errors on generate --- src/Generator.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Generator.php b/src/Generator.php index 326d1f1..409b555 100644 --- a/src/Generator.php +++ b/src/Generator.php @@ -44,6 +44,10 @@ private function allocateLocaleArray($path) foreach ($dir as $fileinfo) { if (!$fileinfo->isDot()) { $noExt = $this->removeExtension($fileinfo->getFilename()); + // Ignore non *.php files (ex.: .gitignore, vim swap files etc.) + if (pathinfo($fileinfo->getFileName())['extension'] !== 'php') { + continue; + } $tmp = include($path . '/' . $fileinfo->getFilename()); $data[$noExt] = $this->adjustArray($tmp);