| Conditions | 1 |
| Paths | 1 |
| Total Lines | 90 |
| Code Lines | 70 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
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 |
||
| 124 | public function conflictingEditProvider() { |
||
| 125 | return array( |
||
| 126 | 'does not add existing label language' => array( array( |
||
| 127 | 'label' => new Diff( array( |
||
| 128 | 'en' => new DiffOpAdd( 'added' ), |
||
| 129 | ), true ), |
||
| 130 | ) ), |
||
| 131 | 'does not change modified label' => array( array( |
||
| 132 | 'label' => new Diff( array( |
||
| 133 | 'en' => new DiffOpChange( 'original', 'changed' ), |
||
| 134 | ), true ), |
||
| 135 | ) ), |
||
| 136 | 'does not change missing label' => array( array( |
||
| 137 | 'label' => new Diff( array( |
||
| 138 | 'de' => new DiffOpChange( 'original', 'changed' ), |
||
| 139 | ), true ), |
||
| 140 | ) ), |
||
| 141 | 'does not remove modified label' => array( array( |
||
| 142 | 'label' => new Diff( array( |
||
| 143 | 'en' => new DiffOpRemove( 'original' ), |
||
| 144 | ), true ), |
||
| 145 | ) ), |
||
| 146 | 'removing missing label is no-op' => array( array( |
||
| 147 | 'label' => new Diff( array( |
||
| 148 | 'de' => new DiffOpRemove( 'original' ), |
||
| 149 | ), true ), |
||
| 150 | ) ), |
||
| 151 | |||
| 152 | 'does not add existing description language' => array( array( |
||
| 153 | 'description' => new Diff( array( |
||
| 154 | 'en' => new DiffOpAdd( 'added' ), |
||
| 155 | ), true ), |
||
| 156 | ) ), |
||
| 157 | 'does not change modified description' => array( array( |
||
| 158 | 'description' => new Diff( array( |
||
| 159 | 'en' => new DiffOpChange( 'original', 'changed' ), |
||
| 160 | ), true ), |
||
| 161 | ) ), |
||
| 162 | 'changing missing description is no-op' => array( array( |
||
| 163 | 'description' => new Diff( array( |
||
| 164 | 'de' => new DiffOpChange( 'original', 'changed' ), |
||
| 165 | ), true ), |
||
| 166 | ) ), |
||
| 167 | 'does not remove modified description' => array( array( |
||
| 168 | 'description' => new Diff( array( |
||
| 169 | 'en' => new DiffOpRemove( 'original' ), |
||
| 170 | ), true ), |
||
| 171 | ) ), |
||
| 172 | 'removing missing description is no-op' => array( array( |
||
| 173 | 'description' => new Diff( array( |
||
| 174 | 'de' => new DiffOpRemove( 'original' ), |
||
| 175 | ), true ), |
||
| 176 | ) ), |
||
| 177 | |||
| 178 | 'does not add existing aliases language' => array( array( |
||
| 179 | 'aliases' => new Diff( array( |
||
| 180 | 'en' => new DiffOpAdd( array( 'added' ) ), |
||
| 181 | ), true ), |
||
| 182 | ) ), |
||
| 183 | 'does not change missing aliases language' => array( array( |
||
| 184 | 'aliases' => new Diff( array( |
||
| 185 | 'de' => new Diff( array( new DiffOpRemove( 'original' ), new DiffOpAdd( 'changed' ) ) ), |
||
| 186 | ), true ), |
||
| 187 | ) ), |
||
| 188 | 'changing missing aliases is no-op' => array( array( |
||
| 189 | 'aliases' => new Diff( array( |
||
| 190 | 'de' => new Diff( array( new DiffOpChange( 'original', 'changed' ) ) ), |
||
| 191 | 'en' => new Diff( array( new DiffOpChange( 'original', 'changed' ) ) ), |
||
| 192 | ), true ), |
||
| 193 | ) ), |
||
| 194 | 'changing missing aliases is no-op (atomic)' => array( array( |
||
| 195 | 'aliases' => new Diff( array( |
||
| 196 | 'de' => new DiffOpChange( array( 'original' ), array( 'changed' ) ), |
||
| 197 | 'en' => new DiffOpChange( array( 'original' ), array( 'changed' ) ), |
||
| 198 | ), true ), |
||
| 199 | ) ), |
||
| 200 | 'removing missing aliases is no-op' => array( array( |
||
| 201 | 'aliases' => new Diff( array( |
||
| 202 | 'de' => new Diff( array( new DiffOpRemove( 'original' ) ) ), |
||
| 203 | 'en' => new Diff( array( new DiffOpRemove( 'original' ) ) ), |
||
| 204 | ), true ), |
||
| 205 | ) ), |
||
| 206 | 'removing missing aliases is no-op (atomic)' => array( array( |
||
| 207 | 'aliases' => new Diff( array( |
||
| 208 | 'de' => new DiffOpRemove( array( 'original' ) ), |
||
| 209 | 'en' => new DiffOpRemove( array( 'original' ) ), |
||
| 210 | ), true ), |
||
| 211 | ) ), |
||
| 212 | ); |
||
| 213 | } |
||
| 214 | |||
| 230 |