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 |
||
| 18 | class BackendController extends PluginEngine |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * @var PluginRepository |
||
| 22 | */ |
||
| 23 | private $plugins; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * BackendController constructor. |
||
| 27 | * @param PluginRepository $plugins |
||
| 28 | */ |
||
| 29 | public function __construct(PluginRepository $plugins) |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Display a list of products available and disable, enable option for super admins. |
||
| 36 | */ |
||
| 37 | public function index() |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Steps required for the application install. |
||
| 44 | * Usually defined for logging & new sql entries. |
||
| 45 | * |
||
| 46 | * @param string $plugin_name |
||
| 47 | * @return mixed |
||
|
|
|||
| 48 | */ |
||
| 49 | View Code Duplication | public function install(string $plugin_name) |
|
| 67 | |||
| 68 | /** |
||
| 69 | * Steps required for the application uninstall. |
||
| 70 | * Usually defined for logging & new sql entries. |
||
| 71 | * |
||
| 72 | * @param string $plugin_name |
||
| 73 | * @return mixed |
||
| 74 | */ |
||
| 75 | View Code Duplication | public function uninstall(string $plugin_name) |
|
| 93 | } |
||
| 94 |
This check looks for the generic type
arrayas a return type and suggests a more specific type. This type is inferred from the actual code.