src/Route/SeriesRoute.php
public function getLastModified(int $id): DateTimeImmutable
    {
        $headers = $this->parent->requestHeaders('head', '/series/'.$id);

        if (array_key_exists('Last-Modified', $headers) && array_key_exists(0, $headers['Last-Modified'])) {
            $lastModified = DateTimeImmutable::createFromFormat(
                static::LAST_MODIFIED_FORMAT,
                $headers['Last-Modified'][0]
            );

            if ($lastModified === false) {
                throw ParseException::lastModified($headers['Last-Modified'][0]);
            }

            return $lastModified;
        }

        throw ParseException::missingHeader('Last-Modified');
    }
public function getLastModified(int $id): DateTimeImmutable
    {
        $headers = $this->parent->requestHeaders('head', '/series/'.$id);

        if (array_key_exists('Last-Modified', $headers) && array_key_exists(0, $headers['Last-Modified'])) {
            $lastModified = DateTimeImmutable::createFromFormat(
                static::LAST_MODIFIED_FORMAT,
                $headers['Last-Modified'][0]
            );

            if ($lastModified === false) {
                throw ParseException::lastModified($headers['Last-Modified'][0]);
            }

            return $lastModified;
        }

        throw ParseException::missingHeader('Last-Modified');
    }
public function getLastModified ( int $ id ) : DateTimeImmutable { $ headers = $ this -> parent -> requestHeaders ( 'head' , '/series/' . $ id ) ; if ( array_key_exists ( 'Last-Modified' , $ headers ) && array_key_exists ( 0 , $ headers [ 'Last-Modified' ] ) ) { $ lastModified = DateTimeImmutable :: createFromFormat ( static :: LAST_MODIFIED_FORMAT , $ headers [ 'Last-Modified' ] [ 0 ] ) ; if ( $ lastModified === false ) { throw ParseException :: lastModified ( $ headers [ 'Last-Modified' ] [ 0 ] ) ; } return $ lastModified ; } throw ParseException :: missingHeader ( 'Last-Modified' ) ; }
Fetches the last modified parameter for a series through a HEAD request.

@param int $id The id of the series.

@return DateTimeImmutable The datetime for when the series was last modified.
@throws ParseException is thrown when the header is missing or couldn't be parsed.
Fetches the last modified parameter for a series through a HEAD request .