BatchUpdateCriteria::rules()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 11
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Http\Requests;
4
5
use Illuminate\Foundation\Http\FormRequest;
6
use App\Services\Validation\Rules\ValidIdRule;
7
use App\Models\Lookup\CriteriaType;
8
use App\Models\Skill;
9
use App\Models\Lookup\SkillLevel;
10
11
class BatchUpdateCriteria extends FormRequest
12
{
13
    /**
14
     * Determine if the user is authorized to make this request.
15
     *
16
     * @return boolean
17
     */
18
    public function authorize(): bool
19
    {
20
        return true;
21
    }
22
23
    /**
24
     * Get the validation rules that apply to the request.
25
     *
26
     * @return string[]
27
     */
28
    public function rules(): array
29
    {
30
        return [
0 ignored issues
show
Bug Best Practice introduced by
The expression return array('*.id' => '...' => 'nullable|string') returns an array which contains values of type array<integer,App\Servic...les\ValidIdRule|string> which are incompatible with the documented value type string.
Loading history...
31
            '*.id' => 'present',
32
            '*.criteria_type_id' => ['required', new ValidIdRule(CriteriaType::class)],
33
            '*.skill_id' => ['required', new ValidIdRule(Skill::class)],
34
            '*.skill_level_id' => ['required', new ValidIdRule(SkillLevel::class)],
35
            '*.description.en' => 'nullable|string',
36
            '*.description.fr' => 'nullable|string',
37
            '*.specificity.en' => 'nullable|string',
38
            '*.specificity.fr' => 'nullable|string',
39
        ];
40
    }
41
}
42