Passed
Pull Request — master (#53)
by
unknown
05:24
created

AssociationRepository   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 22
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A model() 0 3 1
A findByIdWithTrash() 0 3 1
A getAssociationWithPresidentAndCountry() 0 3 1
1
<?php
2
3
namespace App\Repositories\Eloquent;
4
5
use App\Association;
6
7
class AssociationRepository extends BaseRepository
8
{
9
10
11
    /**
12
     * Specify Model class name
13
     *
14
     * @return mixed
15
     */
16
    function model()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
17
    {
18
        return Association::class;
19
    }
20
21
    public function getAssociationWithPresidentAndCountry()
22
    {
23
        return Association::with('president', 'federation.country');
24
    }
25
26
    public function findByIdWithTrash($id)
27
    {
28
        return Association::withTrashed()->find($id);
29
    }
30
31
}