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 |
||
| 14 | class PhpMatcher implements Context |
||
| 15 | { |
||
| 16 | use ApiTrait; |
||
| 17 | |||
| 18 | /** @var Factory */ |
||
| 19 | private $factory; |
||
| 20 | |||
| 21 | public function __construct(HttpHistory $history) |
||
| 26 | |||
| 27 | /** @Then the response content should match: */ |
||
| 28 | View Code Duplication | public function response_content_should_match(PyStringNode $pattern) |
|
| 39 | |||
| 40 | /** @Then the response content should match: */ |
||
| 41 | View Code Duplication | public function response_content_should_not_match(PyStringNode $pattern) |
|
| 55 | } |
||
| 56 |