for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
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:
<?php
/**
* Hosting Plugin for HiPanel
*
* @link https://github.com/hiqdev/hipanel-module-hosting
* @package hipanel-module-hosting
* @license BSD-3-Clause
* @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
*/
namespace hipanel\modules\hosting\menus;
use hiqdev\menumanager\Menu;
class ReaqestDetailMenu extends Menu
{
public $model;
public function items()
$actions = RequestActionsMenu::create(['model' => $this->model])->items();
$items = array_merge($actions, []);
unlink($items['view']);
return $items;
}