private function instantiateHandler($menuHandlerName = null)
{
// If no specific menu handler class name is specified, use the default as per the configuration.
if (null == $menuHandlerName) {
// Get the menu handler class name from the config.
$menuHandlerName = Setting::get('menu-builder.framework_handler');
// If the class name was resolved via ::class (PHP 5.5+)
if (stripos($menuHandlerName, '::class') !== false) {
$end = -1 * strlen('::class');
$menuHandlerName = substr($menuHandlerName, 0, $end);
}
}
// Instantiate the menuHandler and return it.
$menuHandler = new $menuHandlerName($this->app);
return $menuHandler;
}