BuildPolicy::view()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
namespace Faithgen\AppBuild\Policies;
4
5
use App\Models\Ministry;
6
use Faithgen\AppBuild\Models\Build;
7
use Illuminate\Auth\Access\HandlesAuthorization;
8
9
class BuildPolicy
10
{
11
    use HandlesAuthorization;
12
13
    /**
14
     * Determine whether the user can view the build.
15
     *
16
     * @param Ministry $user
17
     * @param Build $build
18
     * @return mixed
19
     */
20
    public function view(Ministry $user, Build $build)
21
    {
22
        return $user->id === $build->ministry_id;
23
    }
24
25
    /**
26
     * Determine whether the user can create builds.
27
     *
28
     * @param Ministry $user
29
     * @return mixed
30
     */
31
    public function create(Ministry $user)
0 ignored issues
show
Unused Code introduced by
The parameter $user is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
32
    {
33
        //
34
    }
35
36
    /**
37
     * Determine whether the user can update the build.
38
     *
39
     * @param Ministry $user
40
     * @param Build $build
41
     * @return mixed
42
     */
43
    public function update(Ministry $user, Build $build)
0 ignored issues
show
Unused Code introduced by
The parameter $user is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $build is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
44
    {
45
        //
46
    }
47
48
    /**
49
     * Determine whether the user can delete the build.
50
     *
51
     * @param Ministry $user
52
     * @param Build $build
53
     * @return mixed
54
     */
55
    public function delete(Ministry $user, Build $build)
0 ignored issues
show
Unused Code introduced by
The parameter $user is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $build is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
56
    {
57
        //
58
    }
59
}
60