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