We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
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 |
||
| 10 | class GlobalVariablesPassTest extends TestCase |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @param mixed $invalidAlias |
||
| 14 | * |
||
| 15 | * @dataProvider invalidAliasProvider |
||
| 16 | */ |
||
| 17 | public function testInvalidAlias($invalidAlias) |
||
| 36 | |||
| 37 | View Code Duplication | public function invalidAliasProvider() |
|
| 48 | } |
||
| 49 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: