Passed
Pull Request — master (#47)
by
unknown
06:41
created

AdministrativeStructureController::getClubs()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Http\Controllers\Api;
4
5
use App\Association;
6
use App\Club;
7
use App\Federation;
8
9
10
class AdministrativeStructureController extends ApiController
11
{
12
13
    public static function getFederations()
14
    {
15
        return Federation::orderBy('id', 'asc')->get(['id as value', 'name as text'])->toArray();
16
    }
17
18
19
    public static function getAssociations($federationId)
20
    {
21
        return Association::where('federation_id', $federationId)->orderBy('id', 'asc')->get(['id as value', 'name as text'])->toArray();
22
23
    }
24
25
    public static function getClubs($federationId, $associationId)
0 ignored issues
show
Unused Code introduced by
The parameter $federationId 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

25
    public static function getClubs(/** @scrutinizer ignore-unused */ $federationId, $associationId)

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...
26
    {
27
        return Club::where('association_id', $associationId)
28
            ->get(['id as value', 'name as text'])->toArray();
29
    }
30
31
}
32