From 7cea0eb0021c661644ca5f8272187829c8b64d4e Mon Sep 17 00:00:00 2001 From: Nathaniel Hammond Date: Tue, 26 Nov 2024 09:16:25 +0000 Subject: [PATCH] PHPstan fix --- src/controllers/BaseStoreManagementController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controllers/BaseStoreManagementController.php b/src/controllers/BaseStoreManagementController.php index c713f5211e..2a34a6c4ea 100644 --- a/src/controllers/BaseStoreManagementController.php +++ b/src/controllers/BaseStoreManagementController.php @@ -9,6 +9,7 @@ use Craft; use craft\commerce\Plugin; +use craft\web\UrlManager; use yii\base\InvalidConfigException; use yii\web\Response as YiiResponse; @@ -42,7 +43,9 @@ public function renderTemplate(string $template, array $variables = [], ?string $variables['storeSettingsNav'] = $this->getStoreSettingsNav(); if (!isset($variables['storeHandle'])) { - $routeParams = Craft::$app->getUrlManager()->getRouteParams(); + /** @var UrlManager $urlManager */ + $urlManager = Craft::$app->getUrlManager(); + $routeParams = $urlManager->getRouteParams(); // Make sure store handle is always passed to the template if (isset($routeParams['storeHandle'])) {