Passed
Push — task/job-index-page ( 35c3e1...5d2876 )
by Yonathan
08:55 queued 11s
created

HrAdvisorPolicy   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 2
c 1
b 0
f 0
dl 0
loc 12
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A view() 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