|
12 | 12 |
|
13 | 13 | namespace B13\Make\Command; |
14 | 14 |
|
15 | | -use B13\Make\PackageResolver; |
16 | 15 | use Symfony\Component\Console\Input\InputInterface; |
17 | 16 | use Symfony\Component\Console\Output\OutputInterface; |
18 | 17 | use Symfony\Component\Console\Style\SymfonyStyle; |
@@ -50,21 +49,14 @@ protected function configure(): void |
50 | 49 | $this->filesystem = GeneralUtility::makeInstance(Filesystem::class); |
51 | 50 | } |
52 | 51 |
|
| 52 | + /** |
| 53 | + * @throws \JsonException |
| 54 | + */ |
53 | 55 | protected function execute(InputInterface $input, OutputInterface $output): int |
54 | 56 | { |
55 | 57 | $this->io = new SymfonyStyle($input, $output); |
| 58 | + $this->package = $this->askForPackage($this->io); |
56 | 59 |
|
57 | | - $packages = $this->getPackageResolver()->getPackageManager()->getActivePackages(); |
58 | | - $choices = array_reduce($packages, function ($result, PackageInterface $package) { |
59 | | - if ($package->getPackageMetaData()->getPackageType() === 'typo3-cms-extension') { |
60 | | - $packageKey = $package->getPackageKey(); |
61 | | - $result[$packageKey] = $packageKey; |
62 | | - } |
63 | | - return $result; |
64 | | - }, []); |
65 | | - |
66 | | - $selectedPackageName = $this->io->choice('Select a package to create acceptance tests for', $choices); |
67 | | - $this->package = $this->getPackageResolver()->resolvePackage($selectedPackageName); |
68 | 60 | $packageKey = $this->package->getPackageKey(); |
69 | 61 | $targetPackagePath = $this->package->getPackagePath(); |
70 | 62 |
|
@@ -194,11 +186,6 @@ protected function substituteMarkersAndSave(string $content, string $target): vo |
194 | 186 | } |
195 | 187 | } |
196 | 188 |
|
197 | | - protected function getPackageResolver(): PackageResolver |
198 | | - { |
199 | | - return GeneralUtility::makeInstance(PackageResolver::class); |
200 | | - } |
201 | | - |
202 | 189 | protected function getNamespace(): string |
203 | 190 | { |
204 | 191 | return (string)key((array)($this->package->getValueFromComposerManifest('autoload')->{'psr-4'} ?? [])); |
|
0 commit comments