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 namespace GeneaLabs\LaravelModelCaching\Tests\Integration; |
||
7 | class CachedBuilderMultipleQueryTest extends IntegrationTestCase |
||
|
|||
8 | { |
||
9 | View Code Duplication | public function testCallingAllThenFirstQueriesReturnsDifferingResults() |
|
18 | |||
19 | View Code Duplication | public function testCallingGetThenFirstQueriesReturnsDifferingResults() |
|
28 | |||
29 | View Code Duplication | public function testUsingDestroyInvalidatesCache() |
|
40 | |||
41 | View Code Duplication | public function testAllMethodCacheGetsInvalidated() |
|
52 | } |
||
53 |