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

AdministrativeStructureController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 19
ccs 0
cts 12
cp 0
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getAssociations() 0 3 1
A getClubs() 0 4 1
A getFederations() 0 3 1
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