Passed
Push — task/comments-api ( c7d753...19d8e5 )
by Yonathan
32:15 queued 19:33
created

HrAdvisorPolicy   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 3
c 1
b 0
f 0
dl 0
loc 17
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A view() 0 3 2
A update() 0 3 2
1
<?php
2
3
namespace App\Policies;
4
5
use App\Models\HrAdvisor;
6
use App\Models\User;
7
8
class HrAdvisorPolicy extends BasePolicy
9
{
10
    /**
11
     * Determine whether the user can view the HrAdvisor.
12
     *
13
     * @param  \App\Models\User  $user
2 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Expected 6 spaces after parameter type; 2 found
Loading history...
14
     * @param  \App\Models\HrAdvisor  $hrAdvisor
2 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Expected 1 spaces after parameter type; 2 found
Loading history...
15
     * @return mixed
16
     */
17
    public function view(User $user, HrAdvisor $hrAdvisor)
18
    {
19
        return $user->isHrAdvisor() && $hrAdvisor->user_id === $user->id;
20
    }
21
22
    public function update(User $user, HrAdvisor $hrAdvisor)
1 ignored issue
show
Coding Style Documentation introduced by
Missing doc comment for function update()
Loading history...
23
    {
24
        return $user->isHrAdvisor() && $hrAdvisor->user_id === $user->id;
25
    }
26
}
27