/** * Display rule description * * @param RuleInterface $rule * @param OutputInterface $output * @return void */ public function describeRule(RuleInterface $rule, OutputInterface $output) { $output->getFormatter()->setStyle('strong', new OutputFormatterStyle(null, null, ['bold', 'reverse'])); $output->getFormatter()->setStyle('em', new OutputFormatterStyle('yellow', null, ['bold'])); $output->getFormatter()->setStyle('code', new OutputFormatterStyle('green')); $output->writeln("<strong>{$rule->getName()}</strong>\n"); $output->writeln("{$rule->getLongDescription()}\n"); }
/** * Add an rule to collection * * @param RuleInterface $rule * @return void */ public function add(RuleInterface $rule) { $this->rules[strtolower($rule->getName())] = $rule; }