Conditions | 9 |
Paths | 256 |
Total Lines | 30 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 90 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
35 | public function toJson() |
||
36 | { |
||
37 | $json = []; |
||
38 | if ($this->registrationIds) { |
||
39 | $json['registration_ids'] = $this->registrationIds; |
||
40 | } |
||
41 | if ($this->collapseKey) { |
||
42 | $json['collapse_key'] = $this->collapseKey; |
||
43 | } |
||
44 | if ($this->data) { |
||
45 | $json['data'] = $this->data; |
||
46 | } |
||
47 | if ($this->notification) { |
||
48 | $json['notification'] = $this->notification; |
||
49 | } |
||
50 | if ($this->delayWhileIdle) { |
||
51 | $json['delay_while_idle'] = $this->delayWhileIdle; |
||
52 | } |
||
53 | if ($this->timeToLive != 2419200) { |
||
54 | $json['time_to_live'] = $this->timeToLive; |
||
55 | } |
||
56 | if ($this->restrictedPackageName) { |
||
57 | $json['restricted_package_name'] = $this->restrictedPackageName; |
||
58 | } |
||
59 | if ($this->dryRun) { |
||
60 | $json['dry_run'] = $this->dryRun; |
||
61 | } |
||
62 | |||
63 | 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.