From dff2fa4f84719852283b82164334bcd87394784b Mon Sep 17 00:00:00 2001 From: Yuriy Yakubskiy Date: Sat, 27 Oct 2018 09:46:37 +0300 Subject: [PATCH] Fixed No directory for Entity issue --- src/Maker/MakeEntity.php | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/src/Maker/MakeEntity.php b/src/Maker/MakeEntity.php index 9b02c10cd..02d6d96c7 100644 --- a/src/Maker/MakeEntity.php +++ b/src/Maker/MakeEntity.php @@ -99,24 +99,9 @@ public function interact(InputInterface $input, ConsoleStyle $io, Command $comma return; } - $entityFinder = $this->fileManager->createFinder('src/Entity/') - // remove if/when we allow entities in subdirectories - ->depth('<1') - ->name('*.php'); - $classes = []; - /** @var SplFileInfo $item */ - foreach ($entityFinder as $item) { - if (!$item->getRelativePathname()) { - continue; - } - - $classes[] = str_replace(['.php', '/'], ['', '\\'], $item->getRelativePathname()); - } - $argument = $command->getDefinition()->getArgument('name'); $question = $this->createEntityClassQuestion($argument->getDescription()); $value = $io->askQuestion($question); - $input->setArgument('name', $value); if ( @@ -466,20 +451,7 @@ private function printAvailableTypes(ConsoleStyle $io) private function createEntityClassQuestion(string $questionText): Question { - $entityFinder = $this->fileManager->createFinder('src/Entity/') - // remove if/when we allow entities in subdirectories - ->depth('<1') - ->name('*.php'); - $classes = []; - /** @var SplFileInfo $item */ - foreach ($entityFinder as $item) { - if (!$item->getRelativePathname()) { - continue; - } - - $classes[] = str_replace('/', '\\', str_replace('.php', '', $item->getRelativePathname())); - } - + $classes = $this->doctrineHelper->getEntitiesForAutocomplete(); $question = new Question($questionText); $question->setValidator([Validator::class, 'notBlank']); $question->setAutocompleterValues($classes);