mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
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.
This commit is contained in:
parent
2dd1b7c943
commit
312eb5ec7c
@ -24,13 +24,11 @@ abstract class AbstractSearch implements SearchInterface
|
|||||||
/**
|
/**
|
||||||
* parse string expected to be a date and transform to a DateTime object.
|
* parse string expected to be a date and transform to a DateTime object.
|
||||||
*
|
*
|
||||||
* @param type $string
|
|
||||||
*
|
|
||||||
* @return \DateTime
|
* @return \DateTime
|
||||||
*
|
*
|
||||||
* @throws ParsingException if the date is not parseable
|
* @throws ParsingException if the date is not parseable
|
||||||
*/
|
*/
|
||||||
public function parseDate($string)
|
public function parseDate(string $string)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
return new \DateTime($string);
|
return new \DateTime($string);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user