Completed
Push — master ( 87f62d...7a1afc )
by Ron
03:00
created

TycoonController::getTycoonsByWorldAndInitial()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 2
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Http\Controllers\Tycoons;
4
5
use App\Http\Controllers\Controller;
6
use Starpeace\Models\Eloquent\Common\Tycoon;
7
8
class TycoonController extends Controller
9
{
10
    public function getTycoonsByWorld($world_id)
11
    {
12
        return Tycoon::leftjoin('worlds_tycoons', 'worlds_tycoons.tycoon_id', '=', 'tycoons.id')
13
            ->where('worlds_tycoons.world_id', $world_id)->get();
14
    }
15
16
    public function getTycoonsByInitial($initial)
17
    {
18
        return Tycoon::where('tycoons.name', 'like', $initial . '%')->get();
19
    }
20
21
    public function getTycoonsByWorldAndInitial($world_id, $initial)
22
    {
23
        return Tycoon::leftjoin('worlds_tycoons', 'worlds_tycoons.tycoon_id', '=', 'tycoons.id')
24
            ->where('worlds_tycoons.world_id', $world_id)
25
            ->where('tycoons.name', 'like', $initial . '%')
26
            ->get();
27
    }
28
29
    public function getTycoons()
30
    {
31
        return Tycoon::all();
32
    }
33
34
    public function getTycoonMapBuildings($map_id, $tycoon_id)
0 ignored issues
show
Unused Code introduced by
The parameter $tycoon_id is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

34
    public function getTycoonMapBuildings($map_id, /** @scrutinizer ignore-unused */ $tycoon_id)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $map_id is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

34
    public function getTycoonMapBuildings(/** @scrutinizer ignore-unused */ $map_id, $tycoon_id)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
35
    {
36
        
37
    }
38
39
    public function getTycoonMapCompanies()
40
    {
41
        
42
    }
43
}