protected function execute(InputInterface $input, OutputInterface $output)
{
$sourceArg = realpath($input->getArgument('source'));
$ruleSetArg = realpath($input->getArgument('ruleset'));
if (false === $sourceArg || false === $ruleSetArg) {
throw new \InvalidArgumentException(sprintf('%s argument is invalid: "%s" is not a path.', $sourceArg ? 'Rule set' : 'Source directory', $sourceArg ? $input->getArgument('ruleset') : $input->getArgument('source')));
}
$config = new Configuration($input->getArgument('ruleset'), $input->getOption('container-cache'), $input->getOption('no-cache'), $input->getOption('cache-dir'), $input->getOption('filter-methods'), $input->getOption('fail'), $input->getOption('verbose'), $input->getOption('log-html'), $input->getOption('output'));
$factory = new DetectorFactory();
$detector = $factory->create($config, $output);
$violations = $detector->checkForDeprecations($sourceArg, $ruleSetArg);
if ($config->failOnDeprecation() && !empty($violations)) {
return 1;
}
return 0;
}