Issues (404)

Branch: dev

app/Http/Requests/BatchUpdateCriteria.php (1 issue)

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