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

PublishStreamRequest::authorize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace SquareetLabs\LaravelOpenVidu\Http\Requests;
4
5
use Illuminate\Foundation\Http\FormRequest;
6
7
/**
8
 * Class PublishStreamRequest
9
 * @package SquareetLabs\LaravelOpenVidu\Http\Requests
10
 */
11
class PublishStreamRequest extends /** @scrutinizer ignore-call */ FormRequest
12
{
13
14
15
    /**
16
     * Determine if the user is authorized to make this request.
17
     *
18
     * @return bool
19
     */
20
    public function authorize()
21
    {
22
        return true;
23
    }
24
25
    /**
26
     * Get the validation rules that apply to the request.
27
     *
28
     * @return array
29
     */
30
    public function rules()
31
    {
32
        return [
33
            'rtspUri' => 'string|required',
34
            'type' => 'string',
35
            'adaptativeBitrate' => 'boolean',
36
            'onlyPlayWithSubscribers' => 'boolean',
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
            'rtspUri.required' => /** @scrutinizer ignore-call */ __('validation.publish.rtspUri_required'),
50
            'adaptativeBitrate.boolean' => /** @scrutinizer ignore-call */ __('validation.publish.adaptativeBitrate_boolean'),
51
            'onlyPlayWithSubscribers.boolean' => /** @scrutinizer ignore-call */ __('validation.publish.onlyPlayWithSubscribers_boolean'),
52
        ];
53
    }
54
}
55