Passed
Push — master ( c8e4bc...17399e )
by Jacobo
04:15
created

SignalRequest::messages()   A

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 */ FormRequest
12
{
13
    /**
14
     * Determine if the user is authorized to make this request.
15
     *
16
     * @return bool
17
     */
18
    public function authorize()
19
    {
20
        return true;
21
    }
22
23
    /**
24
     * Get the validation rules that apply to the request.
25
     *
26
     * @return array
27
     */
28
    public function rules()
29
    {
30
        return [
31
32
            'session' => 'string|required',
33
            'to' => 'array',
34
            'to.*' => 'string|distinct',
35
            'type' => 'string',
36
            'data' => 'string',
37
        ];
38
    }
39
40
    /**
41
     * Get the error messages for the defined validation rules.
42
     *
43
     * @return array
44
     */
45
    public function messages()
46
    {
47
        return [
48
            'session.required' => /** @scrutinizer ignore-call */ __('validation.signal.session_required'),
49
            'to.array' => /** @scrutinizer ignore-call */ __('validation.signal.to_array')
50
        ];
51
    }
52
}
53