From 5b5261982ce7824107a533fd28b9d62e1bfa0c97 Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Wed, 22 Oct 2014 13:08:23 -0400 Subject: [PATCH 1/3] twig:lint does not lint twig files in packages --- src/Command/Lint.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Command/Lint.php b/src/Command/Lint.php index 3b8525c4..093809cf 100644 --- a/src/Command/Lint.php +++ b/src/Command/Lint.php @@ -126,6 +126,12 @@ protected function getFiles($filename, array $files, array $directories) // Get files from passed in options $search = $files; $paths = $this->laravel['view']->getFinder()->getPaths(); + $hints = $this->laravel['view']->getFinder()->getHints(); + if (is_array($hints) && !empty($hints)) { + $paths = array_reduce($hints, function($package, $paths) { + return array_merge($paths, $package); + }, $paths); + } if (!empty($filename)) { $search[] = $filename; From ff333ee464a2703b9a39dadb2091f69ac1cfdc52 Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Mon, 3 Nov 2014 11:14:48 -0500 Subject: [PATCH 2/3] fix tests for #157 --- tests/Command/Lint/Base.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Command/Lint/Base.php b/tests/Command/Lint/Base.php index ba007baa..abf5f87e 100644 --- a/tests/Command/Lint/Base.php +++ b/tests/Command/Lint/Base.php @@ -20,6 +20,7 @@ protected function getApplication(array $customConfig = []) $viewFinder = m::mock('Illuminate\View\ViewFinderInterface'); $viewFinder->shouldReceive('getPaths')->andReturn([]); // paths + $viewFinder->shouldReceive('getHints')->andReturn([]); // hints $viewFinder->shouldReceive('files')->andReturn($finder); $app['view'] = m::mock('Illuminate\View\Factory'); From b83e8ebbc1beed2aa390cccbdb05be7c47be4e67 Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Mon, 3 Nov 2014 11:29:47 -0500 Subject: [PATCH 3/3] code style fix for #157 --- src/Command/Lint.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Command/Lint.php b/src/Command/Lint.php index 093809cf..60712911 100644 --- a/src/Command/Lint.php +++ b/src/Command/Lint.php @@ -128,7 +128,7 @@ protected function getFiles($filename, array $files, array $directories) $paths = $this->laravel['view']->getFinder()->getPaths(); $hints = $this->laravel['view']->getFinder()->getHints(); if (is_array($hints) && !empty($hints)) { - $paths = array_reduce($hints, function($package, $paths) { + $paths = array_reduce($hints, function ($package, $paths) { return array_merge($paths, $package); }, $paths); }