Conditions | 1 |
Paths | 1 |
Total Lines | 90 |
Code Lines | 60 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
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 provideOptions() |
||
53 | { |
||
54 | yield [ |
||
55 | ['cli.php', '--foo'], |
||
56 | true, |
||
57 | IO::VERBOSITY_NORMAL, |
||
58 | ]; |
||
59 | |||
60 | yield [ |
||
61 | ['cli.php', '--foo', '--verbose=0'], |
||
62 | true, |
||
63 | IO::VERBOSITY_VERBOSE, |
||
64 | ]; |
||
65 | |||
66 | yield [ |
||
67 | ['cli.php', '--foo', '--quiet'], |
||
68 | false, |
||
69 | IO::VERBOSITY_QUIET, |
||
70 | ]; |
||
71 | |||
72 | yield [ |
||
73 | ['cli.php', '--foo', '-q'], |
||
74 | false, |
||
75 | IO::VERBOSITY_QUIET, |
||
76 | ]; |
||
77 | |||
78 | yield [ |
||
79 | ['cli.php', '--foo', '-vvv'], |
||
80 | true, |
||
81 | IO::VERBOSITY_DEBUG, |
||
82 | ]; |
||
83 | |||
84 | yield [ |
||
85 | ['cli.php', '--foo', '--verbose=3'], |
||
86 | true, |
||
87 | IO::VERBOSITY_DEBUG, |
||
88 | ]; |
||
89 | |||
90 | yield [ |
||
91 | ['cli.php', '--foo', '--verbose 3'], |
||
92 | true, |
||
93 | IO::VERBOSITY_DEBUG, |
||
94 | ]; |
||
95 | |||
96 | yield [ |
||
97 | ['cli.php', '--foo', '-vv'], |
||
98 | true, |
||
99 | IO::VERBOSITY_VERY_VERBOSE, |
||
100 | ]; |
||
101 | |||
102 | yield [ |
||
103 | ['cli.php', '--foo', '--verbose=2'], |
||
104 | true, |
||
105 | IO::VERBOSITY_VERY_VERBOSE, |
||
106 | ]; |
||
107 | |||
108 | yield [ |
||
109 | ['cli.php', '--foo', '--verbose 2'], |
||
110 | true, |
||
111 | IO::VERBOSITY_VERY_VERBOSE, |
||
112 | ]; |
||
113 | |||
114 | yield [ |
||
115 | ['cli.php', '--foo', '-v'], |
||
116 | true, |
||
117 | IO::VERBOSITY_VERBOSE, |
||
118 | ]; |
||
119 | |||
120 | yield [ |
||
121 | ['cli.php', '--foo', '--verbose=1'], |
||
122 | true, |
||
123 | IO::VERBOSITY_VERBOSE, |
||
124 | ]; |
||
125 | |||
126 | yield [ |
||
127 | ['cli.php', '--foo', '--verbose '], |
||
128 | true, |
||
129 | IO::VERBOSITY_VERBOSE, |
||
130 | ]; |
||
131 | |||
132 | yield [ |
||
133 | ['cli.php', '--no-interaction'], |
||
134 | false, |
||
135 | IO::VERBOSITY_NORMAL, |
||
136 | ]; |
||
137 | |||
138 | yield [ |
||
139 | ['cli.php', '-n'], |
||
140 | false, |
||
141 | IO::VERBOSITY_NORMAL, |
||
142 | ]; |
||
183 |