I'm attaching a patch to fix and cleanup various items found by HHVM. Most of these changes are trivial, except for the last one – fix getRates().
- includes/discovery/functions.inc.php
- Fix reference to sensor_id and add global $debug in check_valid_sensors().
- includes/functions.php
- Make $snmpver an optional parameter on add_device() since it can be empty when discovering devices.
- poll-billing.php
- Add global $options to poll_bill().
- includes/rewrites.php
- Fix reference to the number of entities in humanize_alert_check().
- Remove invalid extra parameter to format_timestamp().
- includes/billing.php
- Add global $device to getValues().
- Quote array keys instead of using constant-style bare words in getLastPortCounter() and getLastMeasurement().
- Fix variable naming bug in getRates(). How did this go unnoticed?
Committed in 5167.