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

JobPosterValidator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
eloc 7
dl 0
loc 20
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A validateUnpublished() 0 11 1
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