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 |
||
11 | class MultipleValuedTest extends BaseTest |
||
12 | { |
||
13 | /** |
||
14 | * @dataProvider matchingConfigProvider |
||
15 | * @covers \eZ\Publish\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig |
||
16 | * @covers \eZ\Publish\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::getValues |
||
17 | */ |
||
18 | View Code Duplication | public function testSetMatchingConfig($matchingConfig) |
|
30 | |||
31 | /** |
||
32 | * Returns a set of matching values, either single or multiple. |
||
33 | * |
||
34 | * @return array |
||
35 | */ |
||
36 | View Code Duplication | public function matchingConfigProvider() |
|
47 | |||
48 | /** |
||
49 | * @covers \eZ\Publish\Core\MVC\RepositoryAware::setRepository |
||
50 | * @covers \eZ\Publish\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::getRepository |
||
51 | */ |
||
52 | public function testInjectRepository() |
||
58 | |||
59 | private function getMultipleValuedMatcherMock() |
||
63 | } |
||
64 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.