Passed
Push — develop ( 0262e3...bcc3c6 )
by Nikita
10:09
created

ServerRequest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 4
eloc 8
c 2
b 1
f 0
dl 0
loc 24
ccs 0
cts 2
cp 0
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');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->get('installed') 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...
19
    }
20
21
    public function processActive(): int
22
    {
23
        return $this->get('process_active');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->get('process_active') 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...
24
    }
25
26
    public function lastProcessCheck(): string
27
    {
28
        return $this->get('last_process_check');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->get('last_process_check') could return the type null which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
Loading history...
29
    }
30
}
31