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 |
||
| 20 | abstract class RouterBaseTest extends TestCase |
||
| 21 | { |
||
| 22 | /** @var \eZ\Publish\Core\MVC\Symfony\SiteAccess\MatcherBuilder */ |
||
| 23 | protected $matcherBuilder; |
||
| 24 | |||
| 25 | /** @var \eZ\Publish\Core\MVC\Symfony\SiteAccess\SiteAccessProviderInterface */ |
||
| 26 | protected $siteAccessProvider; |
||
| 27 | |||
| 28 | protected function setUp(): void |
||
| 34 | |||
| 35 | public function testConstruct(): Router |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @dataProvider matchProvider |
||
| 42 | */ |
||
| 43 | View Code Duplication | public function testMatch(SimplifiedRequest $request, string $siteAccess) |
|
| 51 | |||
| 52 | abstract public function matchProvider(): array; |
||
| 53 | |||
| 54 | abstract protected function createRouter(): Router; |
||
| 55 | |||
| 56 | private function createSiteAccessProviderMock(): SiteAccess\SiteAccessProviderInterface |
||
| 80 | |||
| 81 | /** |
||
| 82 | * @return \eZ\Publish\Core\MVC\Symfony\SiteAccess\Tests\SiteAccessSetting[] |
||
| 83 | */ |
||
| 84 | abstract public function getSiteAccessProviderSettings(): array; |
||
| 85 | } |
||
| 86 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.