From 48ca7db22392d917ffcc71144e2038766aa6074b Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 21 Apr 2022 23:52:00 +0200 Subject: [PATCH] doc fixes --- Admin/Installer.php | 36 +++++++++++++++++--------------- CONTRIBUTING.md | 2 +- Controller/BackendController.php | 6 +++--- Controller/SearchController.php | 2 +- 4 files changed, 24 insertions(+), 22 deletions(-) diff --git a/Admin/Installer.php b/Admin/Installer.php index b88b205..fcf6880 100755 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -43,8 +43,8 @@ final class Installer extends InstallerAbstract /** * Install data from providing modules. * - * @param ApplicationAbstract $app Application - * @param array $data Additional data + * @param ApplicationAbstract $app Application + * @param array{path?:string, lang?:string, app?:int} $data Additional data * * @return array * @@ -67,7 +67,7 @@ final class Installer extends InstallerAbstract } $navData = \json_decode($navFile, true); - if ($navData === false) { + if (!\is_array($navData)) { throw new \Exception(); // @codeCoverageIgnore } @@ -95,22 +95,24 @@ final class Installer extends InstallerAbstract private static function installNavigationLanguage(string $path, string $appName) : void { $files = \scandir($path); - if ($files !== false) { - foreach ($files as $file) { - if (\stripos($file, 'Navigation') !== 0) { - continue; - } + if ($files === false) { + return; + } - $localization = include \rtrim($path, '/') . '/' . $file; - - if (!\is_file($langPath = __DIR__ . '/../../../Web/' . $appName . '/lang/' . $file)) { - \copy(__DIR__ . '/Install/NavigationSkeleton.php', $langPath); - } - - $base = include $langPath; - $new = \array_merge($base, $localization); - \file_put_contents($langPath, 'app->l11nManager, $request, $response); $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000105001, $request, $response)); @@ -208,7 +208,7 @@ final class BackendController extends Controller * * @since 1.0.0 */ - public function viewModuleNavElementSettings(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface + public function viewModuleNavElementSettings(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/' . static::NAME . '/Admin/Settings/Theme/Backend/settings-nav'); @@ -230,7 +230,7 @@ final class BackendController extends Controller * * @since 1.0.0 */ - public function viewModuleNavigationList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface + public function viewModuleNavigationList(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/Navigation/Admin/Settings/Theme/Backend/modules-nav-list'); diff --git a/Controller/SearchController.php b/Controller/SearchController.php index 45184e1..053dfa2 100755 --- a/Controller/SearchController.php +++ b/Controller/SearchController.php @@ -46,7 +46,7 @@ final class SearchController extends Controller * * @since 1.0.0 */ - public function searchGoto(RequestAbstract $request, ResponseAbstract $response, $data = null) : void + public function searchGoto(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void { $this->loadLanguage($request, $response, $request->getData('app'));