Completed
Push — master ( 81fe53...e7743d )
by Pavel
02:34
created

RestPolicy   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A delete() 0 3 1
A allowByDefault() 0 3 1
A show() 0 3 1
A update() 0 3 1
A index() 0 3 1
A create() 0 3 1
1
<?php namespace Pz\LaravelDoctrine\Rest;
2
3
abstract class RestPolicy
4
{
5
    /**
6
     * @return bool
7
     */
8
    public function allowByDefault()
9
    {
10
        return false;
11
    }
12
13
    /**
14
     * @param object $user
15
     *
16
     * @return bool
17
     */
18
    public function index(/** @scrutinizer ignore-unused */ $user)
19
    {
20
        return $this->allowByDefault();
21
    }
22
23
    /**
24
     * @param object $user
25
     *
26
     * @return bool
27
     */
28
    public function show(/** @scrutinizer ignore-unused */ $user)
29
    {
30
        return $this->allowByDefault();
31
    }
32
33
    /**
34
     * @param object $user
35
     *
36
     * @return bool
37
     */
38
    public function create(/** @scrutinizer ignore-unused */ $user)
39
    {
40
        return $this->allowByDefault();
41
    }
42
43
    /**
44
     * @param object $user
45
     * @param object $entity
46
     *
47
     * @return bool
48
     */
49
    public function update(/** @scrutinizer ignore-unused */ $user, /** @scrutinizer ignore-unused */ $entity)
50
    {
51
        return $this->allowByDefault();
52
    }
53
54
    /**
55
     * @param object $user
56
     * @param object $entity
57
     *
58
     * @return bool
59
     */
60
    public function delete(/** @scrutinizer ignore-unused */ $user, $entity)
0 ignored issues
show
Unused Code introduced by
The parameter $entity 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

60
    public function delete(/** @scrutinizer ignore-unused */ $user, /** @scrutinizer ignore-unused */ $entity)

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...
61
    {
62
        return $this->allowByDefault();
63
    }
64
}
65