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

StoreJobPoster::authorize()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 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