Cancelled
Push — test-branch ( 5c534a )
by Yonathan
06:17 queued 06:17
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
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
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
1 ignored issue
show
Coding Style Documentation introduced by
Parameter comment must end with a full stop
Loading history...
15
     *
16
     * @return null
1 ignored issue
show
Coding Style introduced by
Function return type is not void, but function has no return statement
Loading history...
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