| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | public function transform(Port $port) |
||
| 10 | { |
||
| 11 | return [ |
||
| 12 | 'id' => (int) $port->port_id, |
||
|
|
|||
| 13 | 'devic_id' => (int) $port->device_id, |
||
| 14 | 'device_name' => $port->device->hostname, |
||
| 15 | 'alias' => $port->ifAlias, |
||
| 16 | 'speed' => (int) $port->ifSpeed, |
||
| 17 | 'out_unicast_pkts_delta' => (int) $port->ifOutUcastPkts_delta, |
||
| 18 | 'in_unicast_pkts_delta' => (int) $port->ifInUcastPkts_delta, |
||
| 19 | 'type' => $port->ifType, |
||
| 20 | 'description' => $port->ifDescr, |
||
| 21 | ]; |
||
| 22 | } |
||
| 23 | } |
||
| 24 |
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.