WithRestAbilities   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 60
ccs 12
cts 12
cp 1
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A restIndex() 0 3 1
A restDelete() 0 3 1
A restCreate() 0 3 1
A restShow() 0 3 1
A restUpdate() 0 3 1
A defaultRestAccess() 0 3 1
1
<?php namespace Pz\LaravelDoctrine\Rest\Traits;
2
3
trait WithRestAbilities
4
{
5
    /**
6
     * @return bool
7
     */
8 1
    public function defaultRestAccess(/** @scrutinizer ignore-unused */$user)
9
    {
10 1
        return false;
11
    }
12
13
    /**
14
     * @param object $user
15
     *
16
     * @return bool
17
     */
18 1
    public function restIndex($user)
19
    {
20 1
        return $this->defaultRestAccess($user);
21
    }
22
23
    /**
24
     * @param object $user
25
     *
26
     * @return bool
27
     */
28 1
    public function restShow($user, /** @scrutinizer ignore-unused */ $entity)
29
    {
30 1
        return $this->defaultRestAccess($user);
31
    }
32
33
    /**
34
     * @param object $user
35
     *
36
     * @return bool
37
     */
38 1
    public function restCreate($user)
39
    {
40 1
        return $this->defaultRestAccess($user);
41
    }
42
43
    /**
44
     * @param object $user
45
     * @param object $entity
46
     *
47
     * @return bool
48
     */
49 1
    public function restUpdate($user, /** @scrutinizer ignore-unused */ $entity)
50
    {
51 1
        return $this->defaultRestAccess($user);
52
    }
53
54
    /**
55
     * @param object $user
56
     * @param object $entity
57
     *
58
     * @return bool
59
     */
60 1
    public function restDelete($user,  /** @scrutinizer ignore-unused */$entity)
61
    {
62 1
        return $this->defaultRestAccess($user);
63
    }
64
}
65