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

ServerRequest::lastProcessCheck()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 0
cts 0
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
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