Passed
Push — feature/job-builder/step-0 ( 323da6...a76dc5 )
by Tristan
15:33 queued 09:48
created

StoreJobPoster   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 3
dl 0
loc 12
ccs 3
cts 3
cp 1
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 2
    public function authorize(): bool
15
    {
16
        // The STORE job poster method requires the user's manager id.
17 2
        return $this->user()->hasRole('manager')
18 2
           && $this->user()->manager !== null;
19
    }
20
}
21