use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Command\Command as BaseCommand;
-use Drupal\Console\Core\Command\Shared\CommandTrait;
use Drupal\Console\Core\Utils\ConfigurationManager;
use Drupal\Console\Core\Utils\RequirementChecker;
use Drupal\Console\Core\Utils\ChainQueue;
-use Drupal\Console\Core\Style\DrupalStyle;
/**
* Class CheckCommand
*
* @package Drupal\Console\Core\Command
*/
-class CheckCommand extends BaseCommand
+class CheckCommand extends Command
{
- use CommandTrait;
-
/**
* @var RequirementChecker
*/
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
- $io = new DrupalStyle($input, $output);
-
$checks = $this->requirementChecker->getCheckResult();
if (!$checks) {
- $phpCheckFile = $this->configurationManager->getHomeDirectory().'/.console/phpcheck.yml';
-
- if (!file_exists($phpCheckFile)) {
- $phpCheckFile =
- $this->configurationManager->getApplicationDirectory().
- DRUPAL_CONSOLE_CORE.
- 'config/dist/phpcheck.yml';
- }
-
- $io->newLine();
- $io->info($this->trans('commands.check.messages.file'));
- $io->comment($phpCheckFile);
+ $phpCheckFile = $this->configurationManager
+ ->getVendorCoreDirectory() . 'phpcheck.yml';
$checks = $this->requirementChecker->validate($phpCheckFile);
}
if (!$checks['php']['valid']) {
- $io->error(
+ $this->getIo()->error(
sprintf(
- $this->trans('commands.check.messages.php_invalid'),
+ $this->trans('commands.check.messages.php-invalid'),
$checks['php']['current'],
$checks['php']['required']
)
if ($extensions = $checks['extensions']['required']['missing']) {
foreach ($extensions as $extension) {
- $io->error(
+ $this->getIo()->error(
sprintf(
- $this->trans('commands.check.messages.extension_missing'),
+ $this->trans('commands.check.messages.extension-missing'),
$extension
)
);
if ($extensions = $checks['extensions']['recommended']['missing']) {
foreach ($extensions as $extension) {
- $io->commentBlock(
+ $this->getIo()->commentBlock(
sprintf(
$this->trans(
- 'commands.check.messages.extension_recommended'
+ 'commands.check.messages.extension-recommended'
),
$extension
)
if ($configurations = $checks['configurations']['required']['missing']) {
foreach ($configurations as $configuration) {
- $io->error(
+ $this->getIo()->error(
sprintf(
- $this->trans('commands.check.messages.configuration_missing'),
+ $this->trans('commands.check.messages.configuration-missing'),
$configuration
)
);
if ($configurations = $checks['configurations']['required']['overwritten']) {
foreach ($configurations as $configuration => $overwritten) {
- $io->commentBlock(
+ $this->getIo()->commentBlock(
sprintf(
$this->trans(
- 'commands.check.messages.configuration_overwritten'
+ 'commands.check.messages.configuration-overwritten'
),
$configuration,
$overwritten
}
if ($this->requirementChecker->isValid() && !$this->requirementChecker->isOverwritten()) {
- $io->success(
+ $this->getIo()->success(
$this->trans('commands.check.messages.success')
);
}