From 81220b5b2218f7395857ee324695a5d19845edad Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 25 Jul 2024 11:30:33 +0200 Subject: [PATCH] Correct phpstan error: ParsingException is never thrown The typing of the exception had to be changed, because \Datetime throws an \Exception instead of a ParsingException. --- src/Bundle/ChillMainBundle/Search/AbstractSearch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/Search/AbstractSearch.php b/src/Bundle/ChillMainBundle/Search/AbstractSearch.php index a7cb88d55..c4e0fecd9 100644 --- a/src/Bundle/ChillMainBundle/Search/AbstractSearch.php +++ b/src/Bundle/ChillMainBundle/Search/AbstractSearch.php @@ -32,7 +32,7 @@ abstract class AbstractSearch implements SearchInterface { try { return new \DateTime($string); - } catch (ParsingException $ex) { + } catch (\Exception $ex) { $exception = new ParsingException('The date is ' .'not parsable', 0, $ex);