From 9ff8e90f9cf0cd0a37928094cb5f28ac72ca8512 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 22 Sep 2018 16:23:56 +0200 Subject: [PATCH] Static analysis fixes --- Admin/Install/Navigation.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Admin/Install/Navigation.php b/Admin/Install/Navigation.php index c337fa7..1a996cf 100644 --- a/Admin/Install/Navigation.php +++ b/Admin/Install/Navigation.php @@ -31,7 +31,17 @@ class Navigation */ public static function install(string $path, DatabasePool $dbPool) { - $navData = \json_decode(file_get_contents(__DIR__ . '/Navigation.install.json'), true); + $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 */