/** * @param FixerInterface $fixer * * @return string[]|null */ private function getFixersConflicts(FixerInterface $fixer) { static $conflictMap = array('short_array_syntax' => array('long_array_syntax'), 'align_double_arrow' => array('unalign_double_arrow'), 'align_equals' => array('unalign_equals'), 'concat_with_spaces' => array('concat_without_spaces'), 'echo_to_print' => array('print_to_echo'), 'no_blank_lines_before_namespace' => array('single_blank_line_before_namespace'), 'phpdoc_type_to_var' => array('phpdoc_var_to_type')); $fixerName = $fixer->getName(); return array_key_exists($fixerName, $conflictMap) ? $conflictMap[$fixerName] : array(); }
/** * Register fixer. * * @param FixerInterface $fixer * * @return $this */ public function registerFixer(FixerInterface $fixer) { $name = $fixer->getName(); if (isset($this->fixersByName[$name])) { throw new \UnexpectedValueException(sprintf('Fixer named "%s" is already registered.', $name)); } $this->fixers[] = $fixer; $this->fixersByName[$name] = $fixer; return $this; }