public function getFixersPriorityCases()
 {
     $fixer = new Fixer();
     $fixer->registerBuiltInFixers();
     $fixers = array();
     foreach ($fixer->getFixers() as $fixer) {
         $fixers[$fixer->getName()] = $fixer;
     }
     $cases = array(array($fixers['unused_use'], $fixers['extra_empty_lines']), array($fixers['multiple_use'], $fixers['unused_use']), array($fixers['multiple_use'], $fixers['ordered_use']), array($fixers['remove_leading_slash_use'], $fixers['ordered_use']), array($fixers['remove_lines_between_uses'], $fixers['ordered_use']), array($fixers['unused_use'], $fixers['remove_leading_slash_use']), array($fixers['multiple_use'], $fixers['remove_leading_slash_use']), array($fixers['concat_without_spaces'], $fixers['concat_with_spaces']), array($fixers['elseif'], $fixers['braces']), array($fixers['duplicate_semicolon'], $fixers['braces']), array($fixers['duplicate_semicolon'], $fixers['spaces_before_semicolon']), array($fixers['duplicate_semicolon'], $fixers['multiline_spaces_before_semicolon']), array($fixers['standardize_not_equal'], $fixers['strict']), array($fixers['double_arrow_multiline_whitespaces'], $fixers['multiline_array_trailing_comma']), array($fixers['double_arrow_multiline_whitespaces'], $fixers['align_double_arrow']), array($fixers['operators_spaces'], $fixers['align_double_arrow']), array($fixers['operators_spaces'], $fixers['align_equals']), array($fixers['indentation'], $fixers['phpdoc_indent']), array($fixers['phpdoc_order'], $fixers['phpdoc_separation']), array($fixers['phpdoc_no_access'], $fixers['phpdoc_separation']), array($fixers['phpdoc_no_access'], $fixers['phpdoc_order']), array($fixers['phpdoc_no_empty_return'], $fixers['phpdoc_separation']), array($fixers['phpdoc_no_empty_return'], $fixers['phpdoc_order']), array($fixers['phpdoc_no_package'], $fixers['phpdoc_separation']), array($fixers['phpdoc_no_package'], $fixers['phpdoc_order']), array($fixers['phpdoc_no_access'], $fixers['phpdoc_trim']), array($fixers['phpdoc_no_empty_return'], $fixers['phpdoc_trim']), array($fixers['phpdoc_no_package'], $fixers['phpdoc_trim']), array($fixers['phpdoc_separation'], $fixers['phpdoc_trim']), array($fixers['phpdoc_short_description'], $fixers['phpdoc_trim']), array($fixers['phpdoc_var_without_name'], $fixers['phpdoc_trim']), array($fixers['phpdoc_order'], $fixers['phpdoc_trim']), array($fixers['unused_use'], $fixers['line_after_namespace']), array($fixers['linefeed'], $fixers['eof_ending']), array($fixers['php_unit_strict'], $fixers['php_unit_construct']), array($fixers['unary_operators_spaces'], $fixers['logical_not_operators_with_spaces']), array($fixers['unary_operators_spaces'], $fixers['logical_not_operators_with_successor_space']), array($fixers['short_echo_tag'], $fixers['echo_to_print']), array($fixers['short_bool_cast'], $fixers['spaces_cast']), array($fixers['unneeded_control_parentheses'], $fixers['trailing_spaces']), array($fixers['blankline_after_open_tag'], $fixers['no_blank_lines_before_namespace']));
     $docFixerNames = array_filter(array_keys($fixers), function ($name) {
         return false !== strpos($name, 'phpdoc');
     });
     // prepare bulk tests for phpdoc fixers to test that:
     // * `phpdoc_to_comment` is first
     // * `phpdoc_indent` is second
     // * `phpdoc_types` is third
     // * `phpdoc_scalar` is fourth
     // * `phpdoc_params` is last
     $cases[] = array($fixers['phpdoc_to_comment'], $fixers['phpdoc_indent']);
     $cases[] = array($fixers['phpdoc_indent'], $fixers['phpdoc_types']);
     $cases[] = array($fixers['phpdoc_types'], $fixers['phpdoc_scalar']);
     foreach ($docFixerNames as $docFixerName) {
         if (!in_array($docFixerName, array('phpdoc_to_comment', 'phpdoc_indent', 'phpdoc_types', 'phpdoc_scalar'), true)) {
             $cases[] = array($fixers['phpdoc_to_comment'], $fixers[$docFixerName]);
             $cases[] = array($fixers['phpdoc_indent'], $fixers[$docFixerName]);
             $cases[] = array($fixers['phpdoc_types'], $fixers[$docFixerName]);
             $cases[] = array($fixers['phpdoc_scalar'], $fixers[$docFixerName]);
         }
         if ('phpdoc_params' !== $docFixerName) {
             $cases[] = array($fixers[$docFixerName], $fixers['phpdoc_params']);
         }
     }
     return $cases;
 }
Beispiel #2
0
 public function getFixersPriorityCases()
 {
     $fixer = new Fixer();
     $fixer->registerBuiltInFixers();
     $fixers = array();
     foreach ($fixer->getFixers() as $fixer) {
         $fixers[$fixer->getName()] = $fixer;
     }
     return array(array($fixers['php_closing_tag'], $fixers['short_tag']), array($fixers['unused_use'], $fixers['extra_empty_lines']), array($fixers['multiple_use'], $fixers['unused_use']), array($fixers['multiple_use'], $fixers['ordered_use']), array($fixers['remove_lines_between_uses'], $fixers['ordered_use']), array($fixers['concat_without_spaces'], $fixers['concat_with_spaces']), array($fixers['elseif'], $fixers['braces']), array($fixers['duplicate_semicolon'], $fixers['braces']), array($fixers['duplicate_semicolon'], $fixers['spaces_before_semicolon']), array($fixers['duplicate_semicolon'], $fixers['multiline_spaces_before_semicolon']), array($fixers['standardize_not_equal'], $fixers['strict']));
 }
Beispiel #3
0
 public function getFixersPriorityCases()
 {
     $fixer = new Fixer();
     $fixer->registerBuiltInFixers();
     $fixers = array();
     foreach ($fixer->getFixers() as $fixer) {
         $fixers[$fixer->getName()] = $fixer;
     }
     $cases = array(array($fixers['php_closing_tag'], $fixers['short_tag']), array($fixers['unused_use'], $fixers['extra_empty_lines']), array($fixers['multiple_use'], $fixers['unused_use']), array($fixers['multiple_use'], $fixers['ordered_use']), array($fixers['remove_lines_between_uses'], $fixers['ordered_use']), array($fixers['unused_use'], $fixers['remove_leading_slash_use']), array($fixers['multiple_use'], $fixers['remove_leading_slash_use']), array($fixers['concat_without_spaces'], $fixers['concat_with_spaces']), array($fixers['elseif'], $fixers['braces']), array($fixers['duplicate_semicolon'], $fixers['braces']), array($fixers['duplicate_semicolon'], $fixers['spaces_before_semicolon']), array($fixers['duplicate_semicolon'], $fixers['multiline_spaces_before_semicolon']), array($fixers['standardize_not_equal'], $fixers['strict']), array($fixers['double_arrow_multiline_whitespaces'], $fixers['multiline_array_trailing_comma']), array($fixers['double_arrow_multiline_whitespaces'], $fixers['align_double_arrow']), array($fixers['indentation'], $fixers['phpdoc_indent']), array($fixers['phpdoc_order'], $fixers['phpdoc_separation']), array($fixers['phpdoc_no_empty_return'], $fixers['phpdoc_separation']), array($fixers['phpdoc_no_empty_return'], $fixers['phpdoc_order']), array($fixers['phpdoc_no_package'], $fixers['phpdoc_separation']), array($fixers['phpdoc_no_package'], $fixers['phpdoc_order']), array($fixers['phpdoc_no_empty_return'], $fixers['phpdoc_trim']), array($fixers['phpdoc_no_package'], $fixers['phpdoc_trim']), array($fixers['phpdoc_separation'], $fixers['phpdoc_trim']), array($fixers['phpdoc_short_description'], $fixers['phpdoc_trim']), array($fixers['phpdoc_var_without_name'], $fixers['phpdoc_trim']), array($fixers['phpdoc_order'], $fixers['phpdoc_trim']));
     $docFixerNames = array_filter(array_keys($fixers), function ($name) {
         return false !== strpos($name, 'phpdoc');
     });
     // prepare bulk tests for phpdoc fixers to test if:
     // * `phpdoc_to_comment` is first
     // * `phpdoc_indent` is second
     // * `phpdoc_params` is last
     $cases[] = array($fixers['phpdoc_to_comment'], $fixers['phpdoc_indent']);
     foreach ($docFixerNames as $docFixerName) {
         if (!in_array($docFixerName, array('phpdoc_to_comment', 'phpdoc_indent'), true)) {
             $cases[] = array($fixers['phpdoc_to_comment'], $fixers[$docFixerName]);
             $cases[] = array($fixers['phpdoc_indent'], $fixers[$docFixerName]);
         }
         if ('phpdoc_params' !== $docFixerName) {
             $cases[] = array($fixers[$docFixerName], $fixers['phpdoc_params']);
         }
     }
     return $cases;
 }
Beispiel #4
0
 public function getFixersPriorityCases()
 {
     $fixer = new Fixer();
     $fixer->registerBuiltInFixers();
     $fixers = array();
     foreach ($fixer->getFixers() as $fixer) {
         $fixers[$fixer->getName()] = $fixer;
     }
     return array(array($fixers['php_closing_tag'], $fixers['short_tag']), array($fixers['multiple_use'], $fixers['unused_use']), array($fixers['multiple_use'], $fixers['ordered_use']), array($fixers['concat_without_spaces'], $fixers['concat_with_spaces']), array($fixers['elseif'], $fixers['braces']));
 }