From 312eb5ec7c680e8828cc72dd3fb5f24447289c27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 14 Dec 2023 23:05:05 +0100 Subject: [PATCH] Refactor parseDate function signature in AbstractSearch Removed unnecessary comments and added type hinting to the function parseDate in the AbstractSearch class. Any string passed to this function will now explicitly be expected as a string data type, increasing code robustness and easing debugging process. --- src/Bundle/ChillMainBundle/Search/AbstractSearch.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Search/AbstractSearch.php b/src/Bundle/ChillMainBundle/Search/AbstractSearch.php index 9c3f96f5d..a7cb88d55 100644 --- a/src/Bundle/ChillMainBundle/Search/AbstractSearch.php +++ b/src/Bundle/ChillMainBundle/Search/AbstractSearch.php @@ -24,13 +24,11 @@ abstract class AbstractSearch implements SearchInterface /** * parse string expected to be a date and transform to a DateTime object. * - * @param type $string - * * @return \DateTime * * @throws ParsingException if the date is not parseable */ - public function parseDate($string) + public function parseDate(string $string) { try { return new \DateTime($string);