From 1f249fea30e417fd3ca2b9d7c7b2269b4dbd4dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lys=C3=BD?= Date: Wed, 13 Dec 2023 12:04:44 +0100 Subject: [PATCH] Fix PHPStan error about parameter passed to strval() [MAILPOET-5719] --- .../Endpoints/Automations/AutomationTemplateGetEndpoint.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mailpoet/lib/Automation/Engine/Endpoints/Automations/AutomationTemplateGetEndpoint.php b/mailpoet/lib/Automation/Engine/Endpoints/Automations/AutomationTemplateGetEndpoint.php index 18247d606d..d8d001288d 100644 --- a/mailpoet/lib/Automation/Engine/Endpoints/Automations/AutomationTemplateGetEndpoint.php +++ b/mailpoet/lib/Automation/Engine/Endpoints/Automations/AutomationTemplateGetEndpoint.php @@ -32,7 +32,9 @@ class AutomationTemplateGetEndpoint extends Endpoint { } public function handle(Request $request): Response { - $slug = strval($request->getParam('slug')); + /** @var string|null $slug - for PHPStan because strval() doesn't accept a value of mixed */ + $slug = $request->getParam('slug'); + $slug = strval($slug); $template = $this->registry->getTemplate($slug); if (!$template) { throw Exceptions::automationTemplateNotFound($slug);