GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Failed Conditions
Push — master ( 550dab...bc8237 )
by Casper
03:45 queued 02:01
created

PhoneValidation::isOk()   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 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
namespace NStack\Models;
4
5
/**
6
 * Class PhoneValidation
7
 *
8
 * @package NStack\Models
9
 * @author Tiago Araujo <[email protected]>
10
 */
11
class PhoneValidation extends Model
12
{
13
    /** @var boolean */
14
    protected $ok;
15
16
    /** @var String */
17
    protected $countryCode;
18
19
    /** @var String */
20
    protected $nationalNumber;
21
22
    /**
23
     * parse
24
     *
25
     * @param array $data
26
     * @author Tiago Araujo <[email protected]>
27
     */
28 1
    public function parse(array $data)
29
    {
30 1
        $this->ok               = (String)$data['ok'];
0 ignored issues
show
Documentation Bug introduced by
The property $ok was declared of type boolean, but (string)$data['ok'] is of type string. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
31 1
        $this->countryCode      = (String)$data['country_code'];
32 1
        $this->nationalNumber   = (String)$data['national_number'];
33 1
    }
34
35
    /**
36
     * toArray
37
     *
38
     * @return array
39
     * @author Tiago Araujo <[email protected]>
40
     */
41
    public function toArray(): array
42
    {
43
        return [
44
            'ok'                => $this->ok,
45
            'country_code'      => $this->countryCode,
46
            'national_number'   => $this->nationalNumber,
47
        ];
48
    }
49
50
    /**
51
     * @return bool
52
     */
53
    public function isOk(): bool
54
    {
55
        return $this->ok;
56
    }
57
58
    /**
59
     * @return String
60
     */
61
    public function getCountryCode(): String
62
    {
63
        return $this->countryCode;
64
    }
65
66
    /**
67
     * @return String
68
     */
69
    public function getNationalNumber(): String
70
    {
71
        return $this->nationalNumber;
72
    }
73
74
}