ImageValidatorLaravel::existsByIdEvenDeleted()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
namespace OkayBueno\Images\Services\Validation\src;
4
5
use OkayBueno\Images\Services\Validation\ImageValidatorInterface;
6
use OkayBueno\Validation\src\LaravelValidator;
7
8
/**
9
 * Class ImageValidatorLaravel
10
 * @package OkayBueno\Images\Services\Validation\src
11
 */
12
class ImageValidatorLaravel extends LaravelValidator implements ImageValidatorInterface
13
{
14
    /**
15
     * @return array
16
     */
17
    public function create()
18
    {
19
        return [
20
            'filename' => 'required',
21
            'path' => 'required',
22
            'type' => 'sometimes|max:255'
23
        ];
24
    }
25
26
    /**
27
     * @return array
28
     */
29
    public function existsById()
30
    {
31
        return [
32
            'id' => 'required|exists:images,id,deleted_at,NULL'
33
        ];
34
    }
35
36
    /**
37
     * @return array
38
     */
39
    public function existsByIdEvenDeleted()
40
    {
41
        return [
42
            'id' => 'required|exists:images,id'
43
        ];
44
    }
45
46
47
}