Fix PHPStan error about parameter passed to strval()

[MAILPOET-5719]
This commit is contained in:
Jan Lysý
2023-12-13 12:04:44 +01:00
committed by Rostislav Wolný
parent 8b7c1a317f
commit 1f249fea30

View File

@@ -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);