Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
| 1 | <?php |
||
| 5 | class SoundcloudProviderTest extends AbstractOembedProviderTestAbstract |
||
| 6 | { |
||
| 7 | public function testSoundcloud() |
||
| 8 | { |
||
| 9 | $this->providerFlow( |
||
| 10 | 'soundcloud', |
||
| 11 | 'https://soundcloud.com/mediamonks-2/old-spice-workout-anthem', |
||
| 12 | [ |
||
| 13 | 'providerReference' => 'mediamonks-2/old-spice-workout-anthem', |
||
| 14 | 'title' => 'Old Spice Workout Anthem by MediaMonks', |
||
| 15 | 'authorName' => 'MediaMonks', |
||
| 16 | 'copyright' => '', |
||
| 17 | 'focalPoint' => '50-50' |
||
| 18 | ] |
||
| 19 | ); |
||
| 20 | } |
||
| 21 | } |
||
| 22 |