From af791278e1ec9b4b4c347b0764ac66a02b4c350a Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 25 Dec 2018 19:03:01 +0100 Subject: [PATCH] Optimize navigation install --- Admin/Install/Navigation.php | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/Admin/Install/Navigation.php b/Admin/Install/Navigation.php index 1a996cf..8163056 100644 --- a/Admin/Install/Navigation.php +++ b/Admin/Install/Navigation.php @@ -27,24 +27,17 @@ use phpOMS\DataStorage\Database\DatabasePool; class Navigation { /** - * {@inheritdoc} + * Install navigation providing + * + * @param string $path Module path + * @param DatabasePool $dbPool Database pool for database interaction + * + * @return void + * + * @since 1.0.0 */ - public static function install(string $path, DatabasePool $dbPool) + public static function install(string $path = null, DatabasePool $dbPool = null) : void { - $navFile = \file_get_contents(__DIR__ . '/Navigation.install.json'); - - if ($navFile === false) { - throw new \Exception(); - } - - $navData = \json_decode($navFile, true); - - if ($navData === false) { - throw new \Exception(); - } - - $class = '\\Modules\\Navigation\\Admin\\Installer'; - /** @var $class \Modules\Navigation\Admin\Installer */ - $class::installExternal($dbPool, $navData); + \Modules\Navigation\Admin\Installer::installExternal($dbPool, ['path' => __DIR__ . '/Navigation.install.json']); } }