SignalRequest::messages()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
3
namespace SquareetLabs\LaravelOpenVidu\Http\Requests;
4
5
use Illuminate\Foundation\Http\FormRequest;
6
7
/**
8
 * Class SignalRequest
9
 * @package SquareetLabs\LaravelOpenVidu\Http\Requests
10
 */
11
class SignalRequest extends /** @scrutinizer ignore-call */
12
    FormRequest
13
{
14
    /**
15
     * Determine if the user is authorized to make this request.
16
     *
17
     * @return bool
18
     */
19
    public function authorize()
20
    {
21
        return true;
22
    }
23
24
    /**
25
     * Get the validation rules that apply to the request.
26
     *
27
     * @return array
28
     */
29
    public function rules()
30
    {
31
        return [
32
33
            'session' => 'string|required',
34
            'to' => 'array',
35
            'to.*' => 'string|distinct',
36
            'type' => 'string',
37
            'data' => 'string',
38
        ];
39
    }
40
41
    /**
42
     * Get the error messages for the defined validation rules.
43
     *
44
     * @return array
45
     */
46
    public function messages()
47
    {
48
        return [
49
            'session.required' => /** @scrutinizer ignore-call */ __('validation.signal.session_required'),
50
            'to.array' => /** @scrutinizer ignore-call */ __('validation.signal.to_array')
51
        ];
52
    }
53
}
54