Conditions | 9 |
Paths | 256 |
Total Lines | 30 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 19 |
CRAP Score | 11.107 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
35 | 2 | public function toJson() |
|
36 | { |
||
37 | 2 | $json = []; |
|
38 | 2 | if ($this->registrationIds) { |
|
39 | 2 | $json['registration_ids'] = $this->registrationIds; |
|
40 | 2 | } |
|
41 | 2 | if ($this->collapseKey) { |
|
42 | 2 | $json['collapse_key'] = $this->collapseKey; |
|
43 | 2 | } |
|
44 | 2 | if ($this->data) { |
|
45 | 1 | $json['data'] = $this->data; |
|
46 | 1 | } |
|
47 | 2 | if ($this->notification) { |
|
48 | 1 | $json['notification'] = $this->notification; |
|
49 | 1 | } |
|
50 | 2 | if ($this->delayWhileIdle) { |
|
51 | $json['delay_while_idle'] = $this->delayWhileIdle; |
||
52 | } |
||
53 | 2 | if ($this->timeToLive != 2419200) { |
|
54 | $json['time_to_live'] = $this->timeToLive; |
||
55 | } |
||
56 | 2 | if ($this->restrictedPackageName) { |
|
57 | $json['restricted_package_name'] = $this->restrictedPackageName; |
||
58 | } |
||
59 | 2 | if ($this->dryRun) { |
|
60 | $json['dry_run'] = $this->dryRun; |
||
61 | } |
||
62 | |||
63 | 2 | return Json::encode($json); |
|
64 | } |
||
65 | } |
||
66 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.