| Conditions | 3 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 40 | public function getDisplayAmount() |
||
| 41 | { |
||
| 42 | if (in_array($this->type, $this->getBandwidthTypes(), true)) { |
||
|
|
|||
| 43 | return round($this->last / pow(10, 6), 2); |
||
| 44 | } elseif (in_array($this->type, $this->getTrafficTypes(), true)) { |
||
| 45 | return round($this->total / pow(10, 9), 2); |
||
| 46 | } |
||
| 47 | |||
| 48 | return $this->total; |
||
| 49 | } |
||
| 50 | } |
||
| 51 |
Since your code implements the magic getter
_get, this function will be called for any read access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.