SignalRequest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 12
c 1
b 0
f 0
dl 0
loc 40
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A messages() 0 5 1
A rules() 0 9 1
A authorize() 0 3 1
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