This repository was archived by the owner on Jul 12, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
src/main/QafooLabs/Refactoring
Adapters/Symfony/Commands Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ protected function configure()
6060
6161 protected function execute (InputInterface $ input , OutputInterface $ output )
6262 {
63- $ directory = new Directory ($ input ->getArgument ('dir ' ));
63+ $ directory = new Directory ($ input ->getArgument ('dir ' ), getcwd () );
6464
6565 $ codeAnalysis = new StaticCodeAnalysis ();
6666 $ phpNameScanner = new ParserPhpNameScanner ();
Original file line number Diff line number Diff line change @@ -29,17 +29,23 @@ class Directory
2929 */
3030 private $ path ;
3131
32- public function __construct ($ path )
32+ /**
33+ * @var string
34+ */
35+ private $ workingDirectory ;
36+
37+ public function __construct ($ path , $ workingDirectory )
3338 {
3439 $ this ->path = $ path ;
40+ $ this ->workingDirectory = $ workingDirectory ;
3541 }
3642
3743 /**
3844 * @return File[]
3945 */
4046 public function findAllPhpFilesRecursivly ()
4147 {
42- $ workingPath = $ this ->path ;
48+ $ workingDirectory = $ this ->workingDirectory ;
4349
4450 return
4551 new CallbackTransformIterator (
@@ -52,8 +58,8 @@ function (SplFileInfo $file) {
5258 return substr ($ file ->getFilename (), -4 ) === ".php " ;
5359 }
5460 ),
55- function ($ file ) use ($ workingPath ) {
56- return File::createFromPath ($ file ->getPathname (), $ workingPath );
61+ function ($ file ) use ($ workingDirectory ) {
62+ return File::createFromPath ($ file ->getPathname (), $ workingDirectory );
5763 }
5864 )
5965 ;
You can’t perform that action at this time.
0 commit comments