mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fully convert core to a modern module (#13347)
* Core module WIP * update OS::make() * core WIP * try to finish up * switch all core do os Model * Mock WIP * Working tests * cleanup * phpstan fixes * style fixes * fix agent * trim space too and a couple of cleanups * corrected ios test data * missed space * update test data * put escapes back * another net-snmp difference * Fix class description * revert snmp.inc.php change, that can be a different PR * revert snmp.inc.php change, that can be a different PR
This commit is contained in:
@@ -1075,15 +1075,7 @@ function get_vm_parent_id($device)
|
||||
*/
|
||||
function str_to_class($name, $namespace = null)
|
||||
{
|
||||
$pre_format = str_replace(['-', '_'], ' ', $name);
|
||||
$class = str_replace(' ', '', ucwords(strtolower($pre_format)));
|
||||
$class = preg_replace_callback('/^(\d)(.)/', function ($matches) {
|
||||
$numbers = ['Zero', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine'];
|
||||
|
||||
return $numbers[$matches[1]] . strtoupper($matches[2]);
|
||||
}, $class);
|
||||
|
||||
return $namespace . $class;
|
||||
return \LibreNMS\Util\StringHelpers::toClass($name, $namespace);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user