protected function getTimestamp($expiration): ?string
    {
        if (\is_int($expiration) && \mb_strlen((string) $expiration) === 10 && $this->isValidTimeStamp($expiration)) {
            return Chronos::createFromTimestamp($expiration)->toCookieString();
        }

        if (\is_int($expiration)) {
            return Chronos::now()->addSeconds($expiration)->toCookieString();
        }

        if ($expiration instanceof DateTimeInterface) {
            return $expiration->format(DateTime::COOKIE);
        }

        if (\is_string($expiration)) {
            return $expiration;
        }

        return null;
    }
protected function getTimestamp($expiration): ?string
    {
        if (\is_int($expiration) && \mb_strlen((string) $expiration) === 10 && $this->isValidTimeStamp($expiration)) {
            return Chronos::createFromTimestamp($expiration)->toCookieString();
        }

        if (\is_int($expiration)) {
            return Chronos::now()->addSeconds($expiration)->toCookieString();
        }

        if ($expiration instanceof DateTimeInterface) {
            return $expiration->format(DateTime::COOKIE);
        }

        if (\is_string($expiration)) {
            return $expiration;
        }

        return null;
    }
protected function getTimestamp ( $ expiration ) : ? string { if ( \ is_int ( $ expiration ) && \ mb_strlen ( ( string ) $ expiration ) === 10 && $ this -> isValidTimeStamp ( $ expiration ) ) { return Chronos :: createFromTimestamp ( $ expiration ) -> toCookieString ( ) ; } if ( \ is_int ( $ expiration ) ) { return Chronos :: now ( ) -> addSeconds ( $ expiration ) -> toCookieString ( ) ; } if ( $ expiration instanceof DateTimeInterface ) { return $ expiration -> format ( DateTime :: COOKIE ) ; } if ( \ is_string ( $ expiration ) ) { return $ expiration ; } return null ; }
Get timestamp as cookie string format.

@param null|\DateTimeInterface|int|string $expiration

@return null|string
Get timestamp as cookie string format .