PublishStreamRequest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A messages() 0 6 1
A rules() 0 8 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 PublishStreamRequest
9
 * @package SquareetLabs\LaravelOpenVidu\Http\Requests
10
 */
11
class PublishStreamRequest extends /** @scrutinizer ignore-call */
12
    FormRequest
13
{
14
15
16
    /**
17
     * Determine if the user is authorized to make this request.
18
     *
19
     * @return bool
20
     */
21
    public function authorize()
22
    {
23
        return true;
24
    }
25
26
    /**
27
     * Get the validation rules that apply to the request.
28
     *
29
     * @return array
30
     */
31
    public function rules()
32
    {
33
        return [
34
            'rtspUri' => 'string|required',
35
            'type' => 'string',
36
            'adaptativeBitrate' => 'boolean',
37
            'onlyPlayWithSubscribers' => 'boolean',
38
            'data' => 'string'
39
        ];
40
    }
41
42
    /**
43
     * Get the error messages for the defined validation rules.
44
     *
45
     * @return array
46
     */
47
    public function messages()
48
    {
49
        return [
50
            'rtspUri.required' => /** @scrutinizer ignore-call */ __('validation.publish.rtspUri_required'),
51
            'adaptativeBitrate.boolean' => /** @scrutinizer ignore-call */ __('validation.publish.adaptativeBitrate_boolean'),
52
            'onlyPlayWithSubscribers.boolean' => /** @scrutinizer ignore-call */ __('validation.publish.onlyPlayWithSubscribers_boolean'),
53
        ];
54
    }
55
}
56