Conditions | 1 |
Paths | 1 |
Total Lines | 56 |
Code Lines | 54 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 2 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
52 | public function getDefaultFixers() { |
||
53 | return [ |
||
54 | '-psr0', |
||
55 | '-return', |
||
56 | '-concat_without_spaces', |
||
57 | '-empty_return', |
||
58 | 'extra_empty_lines', |
||
59 | 'concat_with_spaces', |
||
60 | 'array_element_no_space_before_comma', |
||
61 | 'array_element_white_space_after_comma', |
||
62 | 'double_arrow_multiline_whitespaces', |
||
63 | 'duplicate_semicolon', |
||
64 | 'function_typehint_space', |
||
65 | 'include', |
||
66 | 'list_commas', |
||
67 | 'multiline_array_trailing_comma', |
||
68 | 'namespace_no_leading_whitespace', |
||
69 | 'newline_after_open_tag', |
||
70 | 'new_with_braces', |
||
71 | 'no_blank_lines_after_class_opening', |
||
72 | 'no_blank_lines_before_namespace', |
||
73 | 'no_empty_lines_after_phpdocs', |
||
74 | 'object_operator', |
||
75 | 'operators_spaces', |
||
76 | 'spaces_cast', |
||
77 | 'ordered_use', |
||
78 | 'phpdoc_indent', |
||
79 | 'phpdoc_inline_tag', |
||
80 | 'phpdoc_no_access', |
||
81 | 'phpdoc_no_package', |
||
82 | 'phpdoc_order', |
||
83 | 'phpdoc_params', |
||
84 | 'phpdoc_scalar', |
||
85 | 'phpdoc_separation', |
||
86 | 'phpdoc_short_description', |
||
87 | 'phpdoc_to_comment', |
||
88 | 'phpdoc_trim', |
||
89 | 'phpdoc_types', |
||
90 | 'phpdoc_type_to_var', |
||
91 | 'print_to_echo', |
||
92 | 'remove_lines_between_uses', |
||
93 | 'self_accessor', |
||
94 | 'short_array_syntax', |
||
95 | 'single_array_no_trailing_comma', |
||
96 | 'single_quote', |
||
97 | 'spaces_before_semicolon', |
||
98 | 'ternary_spaces', |
||
99 | 'trim_array_spaces', |
||
100 | 'unalign_double_arrow', |
||
101 | 'unalign_equals', |
||
102 | 'unary_operators_spaces', |
||
103 | 'unneeded_control_parentheses', |
||
104 | 'unused_use', |
||
105 | 'whitespacy_lines', |
||
106 | ]; |
||
107 | } |
||
108 | } |
||
109 |