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.
This commit is contained in:
Julie Lenaerts 2024-07-25 11:30:33 +02:00
parent 5b0019cde7
commit 81220b5b22

View File

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