librenms-librenms/app/Providers/SnmptrapProvider.php
Jellyfrog 77c531527c Apply fixes from StyleCI (#12117)
* Apply fixes from StyleCI

* Disable style check
2020-09-21 14:54:51 +02:00

35 lines
689 B
PHP

<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use LibreNMS\Interfaces\SnmptrapHandler;
use LibreNMS\Snmptrap\Handlers\Fallback;
class SnmptrapProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
//
}
/**
* Register the application services.
*
* @return void
*/
public function register()
{
$this->app->bind(SnmptrapHandler::class, function ($app, $options) {
$oid = reset($options);
return $app->make(config('snmptraps.trap_handlers')[$oid] ?? Fallback::class);
});
}
}