File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,8 @@ private function doGetClasses(): array
9494
9595 $ dirs = \array_map ('dirname ' , $ files );
9696
97+ $ oldCwd = getcwd ();
98+ chdir ($ this ->rootPath );
9799 $ classes = [];
98100 foreach ($ dirs as $ dir ) {
99101 $ filesForDir = \iterator_to_array ($ this ->getPhpFilesForDir ($ dir ));
@@ -104,6 +106,7 @@ private function doGetClasses(): array
104106 $ classes [] = $ namespace .\str_replace ('/ ' , '\\' , $ fileTrimPrefixSuffix );
105107 }
106108 }
109+ chdir ($ oldCwd );
107110 return $ classes ;
108111 }
109112
@@ -113,8 +116,6 @@ private function doGetClasses(): array
113116 */
114117 private function getPhpFilesForDir (string $ directory ): \Iterator
115118 {
116- $ oldCwd = getcwd ();
117- chdir ($ this ->rootPath );
118119 if (!\is_dir ($ directory )) {
119120 return new \EmptyIterator ();
120121 }
@@ -124,7 +125,6 @@ private function getPhpFilesForDir(string $directory): \Iterator
124125 } else {
125126 $ iterator = new GlobIterator ($ directory .'/*.php ' );
126127 }
127- chdir ($ oldCwd );
128128 return $ iterator ;
129129 }
130130}
You can’t perform that action at this time.
0 commit comments