Skip to content

Commit

Permalink
simplify class loader
Browse files Browse the repository at this point in the history
  • Loading branch information
Frug committed May 9, 2023
1 parent 9044e6a commit 5159da4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/AjaxChat/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@ public static function NewFromConfig(string $configPath) {
return new \AjaxChat\Integrations\Standalone\CustomAJAXChat($config);
}

switch (strtolower($config['integration'])) {
case 'phpbb3':
return new \AjaxChat\Integrations\PhpBB3\CustomAJAXChat($config);
case 'standalone':
default:
return new \AjaxChat\Integrations\Standalone\CustomAJAXChat($config);
}
$integrationFolder = ucwords($config['integration']);
$fullClassName = "\\AjaxChat\\Integrations\\{$integrationFolder}\\CustomAJAXChat";

return new $fullClassName($config);
}

/**
Expand Down

0 comments on commit 5159da4

Please sign in to comment.