Completed
Push — feature/screening-plan ( 46ccc1...3f87fd )
by Tristan
14:07 queued 07:47
created

JobPosterValidator::validateUnpublished()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 11
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace App\Services\Validation;
4
5
use Illuminate\Support\Facades\Validator;
6
use Illuminate\Validation\Rule;
7
use App\Models\JobPoster;
8
9
class JobPosterValidator
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class JobPosterValidator
Loading history...
10
{
11
    /**
12
     * Check to see if JobPoster instance has published set to false
13
     *
14
     * @param \App\Models\JobPoster $jobPoster Incoming Job Poster object
15
     *
16
     * @return null
17
     */
18
    public static function validateUnpublished(JobPoster $jobPoster)
19
    {
20
        Validator::make(
21
            $jobPoster->toArray(),
22
            [
23
                'published' => [
24
                    'required',
25
                    Rule::in([false])
26
                ]
27
            ]
28
        )->validate();
29
    }
30
31
}
32