Code Duplication    Length = 9-9 lines in 2 locations

app/Itil/Controllers/UtilityController.php 1 location

@@ 13-21 (lines=9) @@
10
11
class UtilityController extends Controller {
12
13
    public static function assetSearch($query, $format = 'json') {
14
        $assets = new SdAssets();
15
        $asset = $assets->where('name', 'LIKE', '%' . $query . '%')->select('name as label', 'id as value');
16
17
        if ($format == 'json') {
18
            $asset = $asset->get()->toJson();
19
        }
20
        return $asset;
21
    }
22
23
    public static function assetByTypeId($typeid) {
24
        $assets = new SdAssets();

app/Plugins/ServiceDesk/Controllers/Library/UtilityController.php 1 location

@@ 15-23 (lines=9) @@
12
13
class UtilityController extends Controller {
14
15
    public static function assetSearch($query, $format = 'json') {
16
        $assets = new SdAssets();
17
        $asset = $assets->where('name', 'LIKE', '%' . $query . '%')->select('name as label', 'id as value');
18
19
        if ($format == 'json') {
20
            $asset = $asset->get()->toJson();
21
        }
22
        return $asset;
23
    }
24
25
    public static function assetByTypeId($typeid) {
26
        $assets = new SdAssets();