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

TycoonController   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getTycoonsByInitial() 0 3 1
A getTycoons() 0 3 1
A getTycoonsByWorld() 0 4 1
A getTycoonsByWorldAndInitial() 0 6 1
A getTycoonMapBuildings() 0 2 1
A getTycoonMapCompanies() 0 2 1
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
}