Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DebugCommand.php

function DebugCommand::execute

Same name in this branch
  1. 11.1.x vendor/symfony/serializer/Command/DebugCommand.php \Symfony\Component\Serializer\Command\DebugCommand::execute()

Overrides Command::execute

File

vendor/symfony/validator/Command/DebugCommand.php, line 61

Class

DebugCommand
A console command to debug Validators information.

Namespace

Symfony\Component\Validator\Command

Code

protected function execute(InputInterface $input, OutputInterface $output) : int {
    $class = $input->getArgument('class');
    if (class_exists($class)) {
        $this->dumpValidatorsForClass($input, $output, $class);
        return 0;
    }
    try {
        foreach ($this->getResourcesByPath($class) as $class) {
            $this->dumpValidatorsForClass($input, $output, $class);
        }
    } catch (DirectoryNotFoundException) {
        $io = new SymfonyStyle($input, $output);
        $io->error(\sprintf('Neither class nor path were found with "%s" argument.', $input->getArgument('class')));
        return 1;
    }
    return 0;
}
RSS feed
Powered by Drupal