private function renderRuleOutput() { $this->output->writeln("\n\n <comment>Rules and Violations:</comment> \n"); foreach ($this->rules as $ruleKey => $rule) { $info = Init::getInitInformationByClass($rule); $failedUrls = $this->getFailedUrls($ruleKey); if (count($failedUrls) > 0) { $this->output->writeln(' <error> ' . get_class($rule) . ' </error>'); } else { $this->output->writeln(' <info> ' . get_class($rule) . ' </info>'); } $this->output->writeln(' ' . str_replace("\n", "\n ", $info['documentation']) . "\n"); foreach ($failedUrls as $failedUrl) { $this->output->writeln(' - ' . $failedUrl); } $this->output->writeln(''); } }
/** * Runs the analysis of the given website with all given parameters. * * @param InputInterface $input * @param OutputInterface $output */ protected function execute(InputInterface $input, OutputInterface $output) { $this->init($input, $output); $config = $this->initConfiguration($input->getOption('config_file')); $rules = $config->getRules(); foreach ($rules as $name => $rule) { $info = Init::getInitInformationByClass(get_class($rule)); $output->writeln(' ' . $name . ':'); $output->writeln(' class: ' . get_class($rule)); $output->writeln(' description: ' . str_replace("\n", "\n ", $info['documentation'])); if (count($info['parameters']) > 0) { $output->writeln(' parameter:'); foreach ($info['parameters'] as $parameter) { $output->writeln(' ' . $parameter['name'] . ': ' . $parameter['description'] . ' (default: ' . $parameter['default'] . ')'); } } $output->writeln(''); } }