public function toUrl($rawData): string
    {
        $data = $this->processRawData($rawData);

        if (\is_object($data) && $data instanceof \DateTimeInterface) {
            return $data->format(static::DATE_FORMAT);
        }

        if (\is_int($data)) {
            return (new \DateTime())->setTimestamp($data)->format(static::DATE_FORMAT);
        }

        if (\is_string($data) && $this->match($data)) {
            $sData = (string) $data;
            if ($this->checkDate($sData)) {
                return $sData;
            }
        }

        throw $this->newInvalidToUrl($data);
    }