From 7895c82d1b0e6813eb00d479441b98f3d8d91245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferreyra=2C=20Maximiliano=20Gast=C3=B3n?= Date: Tue, 24 May 2016 05:56:36 -0300 Subject: [PATCH] Fix issue #34 --- src/Manager.php | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/Manager.php b/src/Manager.php index a3d98cf..3282e7c 100644 --- a/src/Manager.php +++ b/src/Manager.php @@ -79,12 +79,29 @@ public function files() // main language files of the application, in this case we will // neglect all vendor files. if (! Str::contains($this->path, 'vendor')) { - $filesByFile = $filesByFile->filter(function ($value, $key) { - return ! Str::contains($key, ':'); - }); + $filesByFile = $this->neglectVendorFiles($filesByFile); + } + + return $filesByFile; + } + + /** + * Nelgect all vendor files. + * + * @param $filesByFile Collection + * @return array + */ + private function neglectVendorFiles($filesByFile) + { + $return = []; + + foreach ($filesByFile->toArray() as $key => $value) { + if (! Str::contains($key, ':')) { + $return[$key] = $value; + } } - return $filesByFile->toArray(); + return $return; } /**