Passed
Push — feature/job-builder/step-03 ( 207311...121bc2 )
by Yonathan
16:09
created

StoreJobPoster   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 3
dl 0
loc 12
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A authorize() 0 5 2
1
<?php
2
3
namespace App\Http\Requests;
4
5
use App\Http\Requests\UpdateJobPoster;
6
7
class StoreJobPoster extends UpdateJobPoster
8
{
9
    /**
10
     * Determine if the user is authorized to make this request.
11
     *
12
     * @return boolean
13
     */
14
    public function authorize(): bool
15
    {
16
        // The STORE job poster method requires the user's manager id.
17
        return $this->user()->hasRole('manager')
18
           && $this->user()->manager !== null;
19
    }
20
}
21