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