Passed
Push — master ( 805c58...4a8ad5 )
by Nikita
10:14 queued 04:50
created

StoreNodeRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 28
c 1
b 0
f 0
dl 0
loc 36
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A id() 0 3 1
A rules() 0 28 1
1
<?php
2
3
namespace Gameap\Http\Requests\API\Admin;
4
5
use Gameap\Http\Requests\JsonRequest;
6
7
class StoreNodeRequest extends JsonRequest
8
{
9
    public function rules()
10
    {
11
        return [
12
            'name'                  => 'required|max:128',
13
            'location'              => 'required|max:128',
14
            'ip'                    => 'required',
15
            'work_path'             => 'required|max:128',
16
            'gdaemon_host'          => 'required|max:128',
17
            'gdaemon_port'          => 'required|numeric|digits_between:1,65535',
18
            'gdaemon_login'         => 'max:128',
19
            'gdaemon_password'      => 'max:128',
20
            'gdaemon_api_key'       => '',
21
            'gdaemon_server_cert'   => 'sometimes',
22
            'client_certificate_id' => 'numeric|exists:client_certificates,id',
23
            'script_install'        => '',
24
            'script_reinstall'      => '',
25
            'script_update'         => '',
26
            'script_start'          => '',
27
            'script_pause'          => '',
28
            'script_unpause'        => '',
29
            'script_stop'           => '',
30
            'script_kill'           => '',
31
            'script_restart'        => '',
32
            'script_status'         => '',
33
            'script_stats'          => '',
34
            'script_get_console'    => '',
35
            'script_send_command'   => '',
36
            'script_delete'         => '',
37
        ];
38
    }
39
40
    public function id(): int
41
    {
42
        return $this->get('id');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->get('id') could return the type null which is incompatible with the type-hinted return integer. Consider adding an additional type-check to rule them out.
Loading history...
43
    }
44
}