Skip to content

Commit 18b0993

Browse files
committed
[TASK] Use methods from abstract command.
1 parent 057a0a1 commit 18b0993

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

Classes/Command/AcceptanceTestsCommand.php

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
namespace B13\Make\Command;
1414

15-
use B13\Make\PackageResolver;
1615
use Symfony\Component\Console\Input\InputInterface;
1716
use Symfony\Component\Console\Output\OutputInterface;
1817
use Symfony\Component\Console\Style\SymfonyStyle;
@@ -50,21 +49,14 @@ protected function configure(): void
5049
$this->filesystem = GeneralUtility::makeInstance(Filesystem::class);
5150
}
5251

52+
/**
53+
* @throws \JsonException
54+
*/
5355
protected function execute(InputInterface $input, OutputInterface $output): int
5456
{
5557
$this->io = new SymfonyStyle($input, $output);
58+
$this->package = $this->askForPackage($this->io);
5659

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);
6860
$packageKey = $this->package->getPackageKey();
6961
$targetPackagePath = $this->package->getPackagePath();
7062

@@ -194,11 +186,6 @@ protected function substituteMarkersAndSave(string $content, string $target): vo
194186
}
195187
}
196188

197-
protected function getPackageResolver(): PackageResolver
198-
{
199-
return GeneralUtility::makeInstance(PackageResolver::class);
200-
}
201-
202189
protected function getNamespace(): string
203190
{
204191
return (string)key((array)($this->package->getValueFromComposerManifest('autoload')->{'psr-4'} ?? []));

0 commit comments

Comments
 (0)