public function formatDate(\DateTimeInterface $dateTime, string $dateLength): string
    {
        $format = $this->getFormat($dateLength);

        return $dateTime->format($format);
    }
public function formatDate(\DateTimeInterface $dateTime, string $dateLength): string
    {
        $format = $this->getFormat($dateLength);

        return $dateTime->format($format);
    }
public function formatDate ( \ DateTimeInterface $ dateTime , string $ dateLength ) : string { $ format = $ this -> getFormat ( $ dateLength ) ; return $ dateTime -> format ( $ format ) ; }
Returns date formatted according to given length of date

@param \DateTimeInterface $dateTime   The date to format
@param string             $dateLength Type of date length. One of the DateLength's class constants.
@return string
Returns date formatted according to given length of date