/**
* {@inheritdoc}
*/
public function run(ContextInterface $context)
{
$files = $context->getFiles()->name('*.php');
if (0 === count($files)) {
return;
}
$config = $this->getConfiguration();
$arguments = ProcessArgumentsCollection::forExecutable($this->getCommandLocation());
$arguments->addOptionalArgument('--configuration=%s', $config['config_file']);
$this->processBuilder->setArguments($arguments->getValues());
$process = $this->processBuilder->getProcess();
$process->run();
if (!$process->isSuccessful()) {
throw new RuntimeException($process->getOutput());
}
}