| Conditions | 1 |
| Paths | 1 |
| Total Lines | 62 |
| Lines | 62 |
| Ratio | 100 % |
| 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 |
||
| 121 | public function invalidIndexNameDataProvider(): Generator |
||
| 122 | { |
||
| 123 | yield [ |
||
| 124 | null, |
||
| 125 | 'valid_alias_name', |
||
| 126 | 'Argument index-name must be a non empty string.' |
||
| 127 | ]; |
||
| 128 | |||
| 129 | yield [ |
||
| 130 | '', |
||
| 131 | 'valid_alias_name', |
||
| 132 | 'Argument index-name must be a non empty string.' |
||
| 133 | ]; |
||
| 134 | |||
| 135 | yield [ |
||
| 136 | true, |
||
| 137 | 'valid_alias_name', |
||
| 138 | 'Argument index-name must be a non empty string.' |
||
| 139 | ]; |
||
| 140 | |||
| 141 | yield [ |
||
| 142 | 1, |
||
| 143 | 'valid_alias_name', |
||
| 144 | 'Argument index-name must be a non empty string.' |
||
| 145 | ]; |
||
| 146 | |||
| 147 | yield [ |
||
| 148 | [], |
||
| 149 | 'valid_alias_name', |
||
| 150 | 'Argument index-name must be a non empty string.' |
||
| 151 | ]; |
||
| 152 | |||
| 153 | yield [ |
||
| 154 | 'valid_index_name', |
||
| 155 | null, |
||
| 156 | 'Argument alias-name must be a non empty string.' |
||
| 157 | ]; |
||
| 158 | |||
| 159 | yield [ |
||
| 160 | 'valid_index_name', |
||
| 161 | '', |
||
| 162 | 'Argument alias-name must be a non empty string.' |
||
| 163 | ]; |
||
| 164 | |||
| 165 | yield [ |
||
| 166 | 'valid_index_name', |
||
| 167 | true, |
||
| 168 | 'Argument alias-name must be a non empty string.' |
||
| 169 | ]; |
||
| 170 | |||
| 171 | yield [ |
||
| 172 | 'valid_index_name', |
||
| 173 | 1, |
||
| 174 | 'Argument alias-name must be a non empty string.' |
||
| 175 | ]; |
||
| 176 | |||
| 177 | yield [ |
||
| 178 | 'valid_index_name', |
||
| 179 | [], |
||
| 180 | 'Argument alias-name must be a non empty string.' |
||
| 181 | ]; |
||
| 182 | } |
||
| 183 | } |
||
| 184 |