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

HrAdvisorPolicy::view()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 2
nc 2
nop 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