From 6ef7cd4640576733a041f2c12f1235447d9e39a8 Mon Sep 17 00:00:00 2001 From: Sascha Nos Date: Fri, 29 Jun 2018 09:53:03 +0200 Subject: [PATCH 1/3] update gitignore file --- .gitignore | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 88e99d5..cb42441 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -vendor -composer.lock \ No newline at end of file +/.idea/ +/vendor/ +/composer.lock \ No newline at end of file From d7ff6c8cce30b7d250496e87d04b4b33f5e7a008 Mon Sep 17 00:00:00 2001 From: Sascha Nos Date: Fri, 29 Jun 2018 10:04:18 +0200 Subject: [PATCH 2/3] only return namespaces which have valid file path (if there are namespaces without callable classes) --- src/ClassFinder.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ClassFinder.php b/src/ClassFinder.php index 2f37a40..e7e77e5 100644 --- a/src/ClassFinder.php +++ b/src/ClassFinder.php @@ -155,6 +155,10 @@ protected function searchClassMap() { foreach ($this->composer->getClassMap() as $fqcn => $file) { + if (!is_string($file)){ + continue; + } + if (Str::s($fqcn)->is($this->namespace.'*')) { $this->foundClasses[realpath($file)] = $fqcn; From 15e5ab8b468b136ca690854b54a67b723fc77c39 Mon Sep 17 00:00:00 2001 From: Sascha Nos Date: Fri, 29 Jun 2018 10:05:19 +0200 Subject: [PATCH 3/3] code optimizations --- src/ClassFinder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ClassFinder.php b/src/ClassFinder.php index e7e77e5..f0ff4a9 100644 --- a/src/ClassFinder.php +++ b/src/ClassFinder.php @@ -156,7 +156,7 @@ protected function searchClassMap() foreach ($this->composer->getClassMap() as $fqcn => $file) { if (!is_string($file)){ - continue; + continue; } if (Str::s($fqcn)->is($this->namespace.'*'))