Passed
Push — master ( b8c666...25f75c )
by Nikita
20:49 queued 09:26
created

ServerRequest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 4
eloc 8
c 2
b 1
f 0
dl 0
loc 24
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 6 1
A processActive() 0 3 1
A lastProcessCheck() 0 3 1
A installed() 0 3 1
1
<?php
2
3
namespace Gameap\Http\Requests\GdaemonAPI;
4
5
class ServerRequest extends JsonRequest
6
{
7
    public function rules()
8
    {
9
        return [
10
            'installed'          => 'nullable|numeric|digits_between:0,9',
11
            'process_active'     => 'nullable|numeric|digits_between:0,1',
12
            'last_process_check' => '',
13
        ];
14
    }
15
16
    public function installed(): ?int
17
    {
18
        return $this->get('installed');
19
    }
20
21
    public function processActive(): ?int
22
    {
23
        return $this->get('process_active');
24
    }
25
26
    public function lastProcessCheck(): ?string
27
    {
28
        return $this->get('last_process_check');
29
    }
30
}
31