Passed
Push — feature/hr-portal ( 7494f2...ae4ab3 )
by Chris
07:23 queued 10s
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